Subject: Re: 29.0.60; csharp-ts-mode: imported namespaces are fontified inconsistently

From: Jostein Kjønigsen <[email-masked]>
Date: Tue, 6 Dec 2022 09:50:57 +0100

I almost forgot about this one.

Here's a patch which solves this issue.

--
Jostein

On 01.12.2022 10:23, Jostein Kjønigsen wrote:
> On 01.12.2022 09:45, Theodor Thornhill wrote:
>> I don't have a strong preference there, so open to suggestions,
>> absolutely.
>>
>> How does visual studio or vscode do it?
>
> VSCode fontifies all namespaces using the same font as types, both in 
> imports and in declarations.
>
> I'm OK with either, but we should at least be consistent.
>
> Historically we've used variable-name face, but I can see for custom 
> imports (for instance "using List = System.Collections.ArrayList;") it 
> might look better if we use this occasion to change to type-face?
>
>> BTW, you should add CC's to the X-Debbugs-CC header, not as a normal CC.
>> That way I won't get CC'd until after the bug is created, and can reply
>> directly :)
>
> I'm not able to send emails from Emacs, so I copy paste all these 
> things into my regular email-client.
>
> No such ability to set a header there :)
>
> -- 
> Jostein

From 2922c5cd3be95cbd7dfc5b427e0bb38b4daf15ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jostein=20Kj=C3=B8nigsen?= <[email-masked]>
Date: Tue, 6 Dec 2022 09:40:03 +0100
Subject: [PATCH] lisp/progmodes/csharp-mode.el: consistent fontification of
 using-directives

---
 lisp/progmodes/csharp-mode.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 054dabfed07..bdddb46e727 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -748,8 +748,11 @@ csharp-ts-mode--font-lock-settings
    :language 'c-sharp
    :feature 'definition
    :override t
-   '((qualified_name (identifier) @font-lock-variable-name-face)
+   '((qualified_name (identifier) @font-lock-type-face)
      (using_directive (identifier) @font-lock-type-face)
+     (using_directive (name_equals
+                       (identifier) @font-lock-type-face
+                       ["="] @default-face))
 
      (enum_declaration (identifier) @font-lock-type-face)
      (enum_member_declaration (identifier) @font-lock-variable-name-face)
-- 
2.34.1