[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 18e1e4a 107/496: Highlight attributes as keywor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 18e1e4a 107/496: Highlight attributes as keyword |
Date: |
Sun, 29 Aug 2021 11:33:17 -0400 (EDT) |
branch: elpa/swift-mode
commit 18e1e4a0eb8d2134c366223759a0632148bd7e33
Author: ap4y <lod@pisem.net>
Commit: ap4y <lod@pisem.net>
Highlight attributes as keyword
---
swift-mode.el | 13 +++++++++++++
test/font-lock-tests.el | 2 ++
2 files changed, 15 insertions(+)
diff --git a/swift-mode.el b/swift-mode.el
index 1e289cb..72ac60e 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -249,6 +249,11 @@
"nonmutating" "operator" "override" "postfix" "precedence" "prefix" "right"
"set" "unowned" "unowned(safe)" "unowned(unsafe)" "weak" "willSet"
"convenience"))
+(defvar swift-mode--attribute-keywords
+ '("assignment" "class_protocol" "exported" "final" "lazy" "noreturn"
+ "NSCopying" "NSManaged" "objc" "optional" "required" "auto_closure"
+ "IBAction" "IBDesignable" "IBInspectable" "IBOutlet"))
+
(defvar swift-mode--keywords
(append swift-mode--type-decl-keywords
swift-mode--val-decl-keywords
@@ -275,6 +280,14 @@
t)
1 font-lock-keyword-face)
+ ;; Attributes
+ ;;
+ ;; Highlight attributes with keyword face
+ (,(rx-to-string
+ `(and "@" bow (or ,@swift-mode--attribute-keywords) eow)
+ t)
+ 0 font-lock-keyword-face)
+
;; Types
;;
;; Any token beginning with an uppercase character is highlighted as a
diff --git a/test/font-lock-tests.el b/test/font-lock-tests.el
index acd14b0..e0e7650 100644
--- a/test/font-lock-tests.el
+++ b/test/font-lock-tests.el
@@ -188,6 +188,8 @@ test will fail."
(check-face string-interpolation/has-variable-face/1
font-lock-variable-name-face "\"foo {{\\\(bar)}}\"")
+(check-face attributes/has-keyword-face/1 font-lock-keyword-face
"{{@IBAction}} func")
+
(provide 'font-lock-tests)
;;; font-lock-tests.el ends here
- [nongnu] elpa/swift-mode cb745d5 029/496: Define basic indentation command., (continued)
- [nongnu] elpa/swift-mode cb745d5 029/496: Define basic indentation command., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0344f63 036/496: Merge pull request #11 from bbatsov/patch-1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 89ce39c 050/496: Format file sections, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0f99a5a 067/496: Tweak docstring to supress checkdoc error, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 821d9af 064/496: Make switch-case indent offset customisable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode bbd8f91 096/496: Add tests for all implemented smie grammars, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cfbc318 092/496: Merge pull request #24 from ap4y/fix_paragraph_movements, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a8fa421 086/496: Use a more descriptive map variable name inside its definition, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0c908ad 103/496: Remove an outdated statement about the indentation code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 41d38bd 117/496: Clarify syntax table for syntactic fontification., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 18e1e4a 107/496: Highlight attributes as keyword,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 98556c1 120/496: Start work on version 0.3, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 8be19fb 108/496: Highlight self and super as keyword, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3caacf3 007/496: Highlight attributes and _ wildcards, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c8f1dbd 014/496: Update readme, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode adb3c13 039/496: Restore Emacs 24.1 requirement, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ab5e170 044/496: Add a few links, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode a44a755 052/496: Add docstrings for internal indent commands, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 62276c3 061/496: Indent cases in enums, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode e168b34 128/496: Don't use implicit semicolon for multi-line dot expressions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode ee83a1d 137/496: Rename swift-indent-multiline-dot-offset to swift-indent-multiline-statement-offset, ELPA Syncer, 2021/08/29