You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks heaps for the great extension. I love it. It adds more fun to development.
That even the one instance that it doesn't apply to is bothering me 馃槀
In the language C#, there's a concept called extension methods. These are functions you import and then you call them on object as if they were defined on the class or struct of this object's type.
Example:
publicclassPerson{publicstringFirstName{get;set;}publicstringLastName{get;set;}}staticclassPersonExtensions{// Add method GetFullName to Person classstaticstringGetFullName(thisPersonvalue)=>$"{value.FirstName}{value.LastName}";}varperson=new Person(){FirstName="Joan",LastName="Smith"};varFullName= person.GetFullName();// call extension method as if it's part of Person class
Console.WriteLine(FullName);
The extension method is not supported by Colormate, and I happened to have a theme ("Noctis Minimus") that makes it look quite unobvious:
So, I wanted to add it. I inspected the entity:
Got this:
Now, to add Colormate support for this, the way I found was to add "extensionMethod" to the setting colormate.semanticTokenTypes.
I also tried adding "other" or "Other" based on the investigation but it didn't work
So, it'd become like this:
"colormate.semanticTokenTypes": [// "Other","extensionMethod",// I have to copy default `colormate.semanticTokenTypes`// This means I lose sync if they get updated in the future in Colormate itself"entity","class.defaultLibrary","class","enum","enumMember","event","function.defaultLibrary","function","interface","macro","method","namespace","parameter","property.readonly","property","struct","type.defaultLibrary","type","variable.readonly.defaultLibrary","variable.readonly","variable"]
This fixes it:
In case you are wondering about colors, I also have these settings:
However, VS Code does not allow me to only add to the existing array. It only allows me to override it. It gets me started with the current default values, but if they change in the future, I won't notice.
So, I'm suggesting one of the following:
Adding another setting like colormate.additionalSemanticTokenTypes that adds to the existing list, kinda similar (opposite) to excludedTextMateTokenScopes
Or just adding "extensionMethod" on your end
Or maybe more generic token type even
I tried a few like "other"/ "other"and even "entity.name.function.extension.cs" but no luck
Finally, sorry for the long issue. I wanted to be as thorough as possible.
Cheers,
The text was updated successfully, but these errors were encountered:
I think your request is completely valid. I actually did that for TextMate scopes, but it's lacking for VSCode's semantic scopes because I was going to add them all anytime they changed (and they haven't changed).
I tried this with C# (not changing any settings), and it colored GetFullName correctly:
None of the other stuff colored though.
The reason entity.name.function.extension.cs didn't work for you is because it's a TextMate scope:
TextMate scopes are what set ColorMate apart from other solutions.
Those TextMate scopes let you have granular control over highlighting including ones that aren't available in VSCode like these import variables:
Hello,
First, thanks heaps for the great extension. I love it. It adds more fun to development.
That even the one instance that it doesn't apply to is bothering me 馃槀
In the language C#, there's a concept called extension methods. These are functions you import and then you call them on object as if they were defined on the class or struct of this object's type.
Example:
The extension method is not supported by Colormate, and I happened to have a theme ("Noctis Minimus") that makes it look quite unobvious:
So, I wanted to add it. I inspected the entity:
Got this:
Now, to add Colormate support for this, the way I found was to add
"extensionMethod"
to the settingcolormate.semanticTokenTypes
.So, it'd become like this:
This fixes it:
![image](https://private-user-images.githubusercontent.com/171637/269451038-a481d694-8b78-45cc-a850-130191f9b81e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA4NTMyNDcsIm5iZiI6MTcyMDg1Mjk0NywicGF0aCI6Ii8xNzE2MzcvMjY5NDUxMDM4LWE0ODFkNjk0LThiNzgtNDVjYy1hODUwLTEzMDE5MWY5YjgxZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxM1QwNjQyMjdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMzU3MWZkYmExOGQ4MDg3MTc5YzA2ZjRhYTQwMWU2ODQzZjkzNzEzMjI3YzE5ODc3ZTgyMWY5NjJlYWRjZmUyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.w4pKqWDbzvpbeqLNDzv_p5YJjrP2Wap2aitdT-s7iB0)
However, VS Code does not allow me to only add to the existing array. It only allows me to override it. It gets me started with the current default values, but if they change in the future, I won't notice.
So, I'm suggesting one of the following:
colormate.additionalSemanticTokenTypes
that adds to the existing list, kinda similar (opposite) toexcludedTextMateTokenScopes
"extensionMethod"
on your endI tried a few like
"other"
/"other"
and even"entity.name.function.extension.cs"
but no luckFinally, sorry for the long issue. I wanted to be as thorough as possible.
Cheers,
The text was updated successfully, but these errors were encountered: