-
Notifications
You must be signed in to change notification settings - Fork 295
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 specific scopes to bool
, num
, double
, int
, Object
, String
, dynamic
in textmate grammar
#4974
Comments
bool
, num
, double
, int
as Keywords
Can you provide some motivation for this? Those things are types so it seems like they should be coloured as such. Unfortunately we can't change colours conditionally in a textmate grammar, so this isn't something we could control as an option there (we could perhaps have a Semantic Tokens modifier for built-in types like these that would allow you to customise them, but based on your other issues I think you're not using Semantic Tokens and that might not help you). To change the textmate grammar, I think it would need to be clear that the majority of users would prefer this change. |
ClarificationI don't need there to be an option to toggle this, I can manually do it in the settings if TextMate grammars are provided. MotivationDart is my second language after C#, and I got used to seeing keywords such as (In fact, the images above are actually from Dart and C#). In my opinion, since In C#, built-in keyworded types are given the scope Therefore, in Dart, these built-in types could be given scopes such as:
|
One option is that we change Lines 231 to 234 in 622472f
This should keep the same colouring by default, but I think would allow you to customise the colours yourself in the VS Code settings. I think we should only do it for the items in that existing list though. Types like Set/List/Map/etc. are not really special - they are just classes that live inside the SDK (like hundreds of other classes). The textmate grammar cannot tell the difference between |
That sounds perfect! What about |
Yeah, I think it would be reasonable to include that too. |
bool
, num
, double
, int
as Keywordsbool
, num
, double
, int
, Object
, String
, dynamic
in textmate grammar
Ah sorry, I misunderstood from comments in #4963 and thought you had semantic tokens disabled. Semantic Tokens will completely replace the textmate grammar (this is VS Code behaviour), although the grammar will be used immediately when you open a file and then replaced when the tokens arrive. In that case, supporting this would require server changes to add additional modifiers to those types. |
Sorry, in that issue I meant something like "this syntax highlighting does not need semantic tokens". Would it be wise to implement both? (I.e. in this v3.84.0, release TextMate grammars, and later release semantic highlighting)? |
Treat
bool
,num
,double
, andint
as keywords.Note
It is not necessary to change the default colouring for these types.
These could be configured by the user, or by external theme packs.
Before:
After:
(Ignore the difference in bracket colours).
This could also apply to
String
,Map
,List
,Set
,Object
, anddynamic
.The text was updated successfully, but these errors were encountered: