[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode b4943f6 313/468: Add luadoc keyword fontification
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode b4943f6 313/468: Add luadoc keyword fontification (issue #71) |
Date: |
Thu, 5 Aug 2021 04:59:00 -0400 (EDT) |
branch: elpa/lua-mode
commit b4943f685d0056fb960ac3399b8f54ad89c93196
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
Add luadoc keyword fontification (issue #71)
---
lua-mode.el | 10 +++++++++-
test/test-font-lock.el | 31 +++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/lua-mode.el b/lua-mode.el
index 2fd79e6..e2e1ac7 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -646,7 +646,15 @@ Groups 6-9 can be used in any of argument regexps."
(3 font-lock-warning-face t noerror)))
(,(lua-rx (or bol ";") ws lua-funcheader)
- (1 font-lock-function-name-face)))
+ (1 font-lock-function-name-face))
+
+ (,(lua-rx (or (group-n 1
+ "@" (symbol "author" "copyright" "field" "release"
+ "return" "see" "usage" "description"))
+ (seq (group-n 1 "@" (symbol "param" "class" "name")) ws+
+ (group-n 2 lua-name))))
+ (1 font-lock-keyword-face t)
+ (2 font-lock-variable-name-face t noerror)))
"Default expressions to highlight in Lua mode.")
diff --git a/test/test-font-lock.el b/test/test-font-lock.el
index 9009555..b89037d 100644
--- a/test/test-font-lock.el
+++ b/test/test-font-lock.el
@@ -181,3 +181,34 @@ goto f12o"
;; of another variable
(it "does not fontify after symbols ending with \"goto\""
(expect "JUNKgoto foo" :to-be-fontified-as '(nil))))
+
+
+(describe "Fontification of LuaDoc keywords"
+ (it "works"
+ (expect "\
+-- @author foo baz
+-- @copyright foo baz
+-- @field foo baz
+-- @param foo baz
+-- @release foo baz
+-- @return foo baz
+-- @see foo baz
+-- @usage foo baz
+-- @class foo baz
+-- @description foo baz
+-- @name foo baz"
+ :to-be-fontified-as
+ '(("-- " comment-delimiter "@author" keyword " foo baz" comment)
+ ("-- " comment-delimiter "@copyright" keyword " foo baz" comment)
+ ("-- " comment-delimiter "@field" keyword " foo baz" comment)
+ ("-- " comment-delimiter "@param" keyword " " comment
+ "foo" variable-name " baz" comment)
+ ("-- " comment-delimiter "@release" keyword " foo baz" comment)
+ ("-- " comment-delimiter "@return" keyword " foo baz" comment)
+ ("-- " comment-delimiter "@see" keyword " foo baz" comment)
+ ("-- " comment-delimiter "@usage" keyword " foo baz" comment)
+ ("-- " comment-delimiter "@class" keyword
+ " " comment "foo" variable-name " baz" comment)
+ ("-- " comment-delimiter "@description" keyword " foo baz"
comment)
+ ("-- " comment-delimiter "@name" keyword " " comment
+ "foo" variable-name " baz" comment)))))
- [nongnu] elpa/lua-mode a0490fc 150/468: lua-font-lock-keywords: highlight hash-bang line as comment (#17), (continued)
- [nongnu] elpa/lua-mode a0490fc 150/468: lua-font-lock-keywords: highlight hash-bang line as comment (#17), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6563aeb 156/468: Merge pull request #30 from vhallac/fix-22, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9d75878 159/468: lua-font-lock-keywords: highlight numbers as constants (issue #15), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c2f8a7f 175/468: Use define-derived-mode, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9f5107e 181/468: Fix population of lua-mode-syntax-table (issue #42), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode f92ced5 283/468: lua-send-region: send extra printline, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 68cd23d 292/468: Merge pull request #85 from immerrr/beginning-of-proc-regex, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 532701b 298/468: Add missing Lua 5.3 functions and modules, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 445bad6 301/468: Merge pull request #92 from ramnes/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7f8fbf2 308/468: lua-mode: don't remove syntax-table during unfontification, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b4943f6 313/468: Add luadoc keyword fontification (issue #71),
Philip Kaludercic <=
- [nongnu] elpa/lua-mode debba6c 317/468: Use electric-indent-mode for per-char electric indentation, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode bdf121b 318/468: New release 20151025, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4b5aad7 326/468: lua-try-match-multiline-begin: don't do syntax-ppss after the opener, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a9945c9 340/468: possibility to connect to remote lua process, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0407042 153/468: Make lua-with-silent-modifications available during byte-compilation, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b1dc70c 158/468: lua-font-lock-keywords: highlight builtin symbols (issue #15), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 52dcf7b 167/468: Merge pull request #35 from vhallac/fix-34, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a3016a2 176/468: Avoid polluting "global namespace" when striving for backward compatibility, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b124dd0 194/468: Add field containing commit SHA expanded during archive creation., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 64c1e94 197/468: lua--builtins: add "self" as keyword, Philip Kaludercic, 2021/08/05