Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more detailed scopes to C# language rules, to allow finer syntax coloring control #4896

Closed
kraybit opened this issue Nov 16, 2021 · 2 comments

Comments

@kraybit
Copy link

kraybit commented Nov 16, 2021

Feature Request Description

  • I'd like to be able to set different colors for different storage modifers like public and private, in C# code. For this I believe we'd need more detailed scopes.
  • Right now, both the public and private modifier has the textmate scope storage.modifier.cs, source.cs, which means it's impossible (?) to distinguish between them when coloring.

Suggestion

  • Add finer scopes, such as storage.modifier.public.cs for the public modifier, and so on.
  • So that settings like these would work in VS Code:
"editor.tokenColorCustomizations": {
  "textMateRules": [
    {
      "scope": "storage.modifier.public",
      "settings":{"foreground": "#F00"}
    }
  ]
}

Example of what does not work right now, as storage.modifier.public does not exist.

History

This issue was originally posted on microsoft/vscode

Environment information

VSCode version: 1.62.2
C# Extension: 1.23.16

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.402 Commit: e9d3381880

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.402\

Host (useful for support):
Version: 5.0.11
Commit: f431858f8b

.NET SDKs installed:
5.0.103 [C:\Program Files\dotnet\sdk]
5.0.402 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Visual Studio Code Extensions
Extension Author Version
bio-dark-theme studiobio 0.1.5
cpptools ms-vscode 1.7.1
csharp ms-dotnettools 1.23.16
material-icon-theme PKief 4.10.0
theme-dracula dracula-theme 2.24.0
todo-tree Gruntfuggly 0.0.214
unity-code-snippets kleber-swf 1.3.0
unity-debug Unity 3.0.2
vscode-counter uctakeoff 2.3.0
vscode-theme-onedark akamud 2.2.3
vscode-unitymeta PTD 0.0.7
@JoeRobich
Copy link
Member

@kraybit This extension uses Roslyn for semantic colorization, when "csharp.semanticHighlighting.enabled" is "true". Could you make this request againt Roslyn to provide this extra semantic information https://github.com/dotnet/roslyn/issues

@JoeRobich
Copy link
Member

Closing due to the roslyn tracking issue being closed.

@JoeRobich JoeRobich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants