Skip to content

Commit 0d35431

Browse files
committed
Fix fontification of namespaces to match using-statement rules.
1 parent 1de5644 commit 0d35431

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

csharp-mode-tests.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@
123123
"WithNumbers09.Ok" 'font-lock-constant-face
124124
))
125125

126+
(ert-deftest fontification-of-namespace-statements ()
127+
(assess-face-in-file= "./test-files/namespace-fontification.cs"
128+
"namespace" 'font-lock-keyword-face
129+
"Reference" 'font-lock-constant-face
130+
"Under_scored" 'font-lock-constant-face
131+
"WithNumbers09.Ok" 'font-lock-constant-face
126132
))
127133

128134
(defun list-repeat-once (mylist)

csharp-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ to work properly with code that includes attributes.
11101110
;; this needs to be done in the matchers-after because
11111111
;; otherwise the namespace names get the font-lock-type-face,
11121112
;; due to the energetic efforts of c-forward-type.
1113-
,`("\\<\\(namespace\\)[ \t\n\r\f\v]+\\(\\(?:[A-Za-z_][[:alnum:]]*\\.\\)*[A-Za-z_][[:alnum:]]*\\)"
1113+
,`("\\<\\(namespace\\)[ \t\n\r\f\v]+\\(\\(?:[A-Za-z0-9_]+\\.\\)*[A-Za-z0-9_]+\\)"
11141114
2 font-lock-constant-face t)
11151115

11161116

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Reference {
2+
3+
}
4+
5+
namespace Under_Scored {
6+
7+
}

0 commit comments

Comments
 (0)