branch: externals/csharp-mode commit f6400193607789ab129d7959522015a619339e53 Author: Tom Willemse <t...@ryuslash.org> Commit: Tom Willemse <t...@ryuslash.org>
Fix display of ‘package’ as any sort of name ‘java-mode’ sets up "package" to be displayed as a keyword using both the ‘c-ref-list-kwds’ and ‘c-other-decl-kwds’. Override these constants for ‘csharp-mode’ so that a variable named ‘package’ doesn’t show up as a keyword. Because both constants are set to nil this also removes "import" from the list of keywords. --- csharp-mode-tests.el | 12 ++++++++++++ csharp-mode.el | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el index 85b2618..6e5ac24 100644 --- a/csharp-mode-tests.el +++ b/csharp-mode-tests.el @@ -67,6 +67,18 @@ "value" 'font-lock-constant-face )) +(ert-deftest fontification-of-package () + (require 'assess) + (assess-face-in-text= + "var package = true;" + "package" 'font-lock-variable-name-face)) + +(ert-deftest fontification-of-import () + (require 'assess) + (assess-face-in-text= + "var import = true;" + "import" 'font-lock-variable-name-face)) + (ert-deftest fontification-of-literals-allows-multi-line-strings () (require 'assess) (should (assess-face-at= diff --git a/csharp-mode.el b/csharp-mode.el index 0fea1d1..7793072 100644 --- a/csharp-mode.el +++ b/csharp-mode.el @@ -1399,6 +1399,12 @@ This regexp is assumed to not match any non-operator identifier." (c-lang-defconst c-other-block-decl-kwds csharp '("namespace")) +(c-lang-defconst c-ref-list-kwds + csharp nil) + +(c-lang-defconst c-other-decl-kwds + csharp nil) + (c-lang-defconst c-other-kwds csharp '("sizeof" "typeof" "is" "as" "yield" "where" "select" "in" "from" "let" "orderby" "ascending" "descending"