emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/csharp-mode 0d35431 228/459: Fix fontification of names


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode 0d35431 228/459: Fix fontification of namespaces to match using-statement rules.
Date: Sun, 22 Aug 2021 13:59:33 -0400 (EDT)

branch: externals/csharp-mode
commit 0d354311bae0ca8e51c4f7b1c8abef90b37f26d6
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>

    Fix fontification of namespaces to match using-statement rules.
---
 csharp-mode-tests.el                  | 6 ++++++
 csharp-mode.el                        | 2 +-
 test-files/namespace-fontification.cs | 7 +++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 1e5a954..584da2d 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -123,6 +123,12 @@
                         "WithNumbers09.Ok" 'font-lock-constant-face
                         ))
 
+(ert-deftest fontification-of-namespace-statements ()
+  (assess-face-in-file= "./test-files/namespace-fontification.cs"
+                        "namespace" 'font-lock-keyword-face
+                        "Reference" 'font-lock-constant-face
+                        "Under_scored" 'font-lock-constant-face
+                        "WithNumbers09.Ok" 'font-lock-constant-face
                         ))
 
 (defun list-repeat-once (mylist)
diff --git a/csharp-mode.el b/csharp-mode.el
index a7dd0b4..215f4f2 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -1110,7 +1110,7 @@ to work properly with code that includes attributes.
            ;; this needs to be done in the matchers-after because
            ;; otherwise the namespace names get the font-lock-type-face,
            ;; due to the energetic efforts of c-forward-type.
-           ,`("\\<\\(namespace\\)[ 
\t\n\r\f\v]+\\(\\(?:[A-Za-z_][[:alnum:]]*\\.\\)*[A-Za-z_][[:alnum:]]*\\)"
+           ,`("\\<\\(namespace\\)[ 
\t\n\r\f\v]+\\(\\(?:[A-Za-z0-9_]+\\.\\)*[A-Za-z0-9_]+\\)"
               2 font-lock-constant-face t)
 
 
diff --git a/test-files/namespace-fontification.cs 
b/test-files/namespace-fontification.cs
new file mode 100644
index 0000000..9c7e8dd
--- /dev/null
+++ b/test-files/namespace-fontification.cs
@@ -0,0 +1,7 @@
+namespace Reference {
+
+}
+
+namespace Under_Scored {
+
+}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]