branch: elpa/swift-mode commit 0ad58657c901d0c543e843d586f2d5f4e0e8619c Merge: 3298fb1 0808a2b Author: Bozhidar Batsov <bozhidar.bat...@gmail.com> Commit: Bozhidar Batsov <bozhidar.bat...@gmail.com>
Merge pull request #71 from ap4y/access_modifiers_font_lock Add font-lock rules for access modifier keywords --- swift-mode.el | 2 +- test/font-lock-tests.el | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/swift-mode.el b/swift-mode.el index 297d2af..b94ef2b 100644 --- a/swift-mode.el +++ b/swift-mode.el @@ -332,7 +332,7 @@ '("associativity" "didSet" "get" "infix" "inout" "left" "mutating" "none" "nonmutating" "operator" "override" "postfix" "precedence" "prefix" "right" "set" "unowned" "unowned(safe)" "unowned(unsafe)" "weak" "willSet" "convenience" - "required" "dynamic" "final" "lazy" "optional")) + "required" "dynamic" "final" "lazy" "optional" "private" "public" "internal")) (defvar swift-mode--attribute-keywords '("class_protocol" "exported" "noreturn" diff --git a/test/font-lock-tests.el b/test/font-lock-tests.el index d4e5484..5772553 100644 --- a/test/font-lock-tests.el +++ b/test/font-lock-tests.el @@ -148,6 +148,9 @@ test will fail." (check-face func-name/has-function-name-face/4 font-lock-function-name-face "func {{foo}}<T>") (check-face func-name/has-function-name-face/6 font-lock-function-name-face "func {{foo}}<T>(param: T) -> U {}") +(check-face func-access-control/has-keyword-face/1 font-lock-keyword-face "{{private}} func foo() {}") +(check-face func-access-control/has-keyword-face/2 font-lock-keyword-face "{{public}} func foo() {}") +(check-face func-access-control/has-keyword-face/3 font-lock-keyword-face "{{internal}} func foo() {}") (check-face func-return-type/has-type-face/1 font-lock-type-face "func foo() -> {{U}} {}") (check-face func-return-type/arrow-has-default-face/1 nil "func foo() {{->}} U {}")