branch: elpa/swift-mode
commit 8be19fb29f44c6c167a4c044470f96f9ea976a36
Author: ap4y <[email protected]>
Commit: ap4y <[email protected]>
Highlight self and super as keyword
---
swift-mode.el | 4 ++++
test/font-lock-tests.el | 3 +++
2 files changed, 7 insertions(+)
diff --git a/swift-mode.el b/swift-mode.el
index 72ac60e..24bdff4 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -234,6 +234,9 @@
(defvar swift-mode--val-decl-keywords
'("let" "var"))
+(defvar swift-mode--context-variables-keywords
+ '("self" "super"))
+
(defvar swift-mode--fn-decl-keywords
'("deinit" "func" "init"))
@@ -257,6 +260,7 @@
(defvar swift-mode--keywords
(append swift-mode--type-decl-keywords
swift-mode--val-decl-keywords
+ swift-mode--context-variables-keywords
swift-mode--fn-decl-keywords
swift-mode--misc-keywords
swift-mode--statement-keywords
diff --git a/test/font-lock-tests.el b/test/font-lock-tests.el
index e0e7650..3bdaa4e 100644
--- a/test/font-lock-tests.el
+++ b/test/font-lock-tests.el
@@ -188,6 +188,9 @@ test will fail."
(check-face string-interpolation/has-variable-face/1
font-lock-variable-name-face "\"foo {{\\\(bar)}}\"")
+(check-face self/has-keyword-face/1 font-lock-keyword-face "{{self}}.foo")
+(check-face super/has-keyword-face/1 font-lock-keyword-face "{{super}}.foo")
+
(check-face attributes/has-keyword-face/1 font-lock-keyword-face
"{{@IBAction}} func")
(provide 'font-lock-tests)