emacs-csharp / csharp-mode

A major-mode for editing C# in emacs
GNU General Public License v3.0
154 stars 47 forks source link

Support static using imports #238

Closed josteink closed 1 year ago

josteink commented 3 years ago

In latest C# you can import specific classes from specific namespaces using the following syntax:

using System;
// ...
using static Namespace.Subnamespace.Class;

Docs on syntax can be found here.

We should try to get this implemented in csharp-mode too, and in particular csharp-tree-sitter-mode :)

theothornhill commented 3 years ago

Something like this?

image
theothornhill commented 3 years ago

Added in 093f0f2

Keeping it open until csharp-mode is fixed as well :)

josteink commented 3 years ago

This was mostly meant as a reminder to self, but uh, if you insist 😅

I can try to fix the boring “old” major-mode.

theothornhill commented 3 years ago

I think the simplest fix is to add it as a primitive keyword. It will get a different color, but will be fontified. The other groups give semantic meaning as well, and is bound to break things - maybe :)

josteink commented 1 year ago

Old issue is old. Closing :)