Closed sharpchen closed 1 year ago
Same with the self
parameter in Python:
Compare that with this
in JS:
Isn't
self
and this
are special key words? I have C_pp: Enhanced Colorization enabled.
Code Snippets:
class User:
def __init__(self,userID,user_name):
self.id = userID
self.user_name = user_name
self.followers = 0
self.following =0`
def follow(self,user):
user.followers+=1
self.following+=1
userOne = User("001","Rabab")
userTwo = User("002","Jon")
userOne.follow(userTwo)
print(userOne.followers)
print(userOne.following)
print(userTwo.followers)
print(userTwo.following)`
'class Person {
constructor(name, job) {
this.name = name;
this.job = job;
}
print() {
const { name, job } = this;
console.log(`${name}, ${job}`);
}
}
const thatGuy = new Person('John Doe', 'Software Engineer');
thatGuy.print();'
@UPIMMUNITY Thanks for providing bug sample! Fixed in 1.8.9 version.
@rababR1 It looks normal on my computer.
When I turn on semantic Highlighting, it looks like yours. Either
false
or configuredByTheme
, it looks correct.
Eva Theme doesn't support this feature yet, you can see why in issue 54.
@fisheva
Please add colorization for class access modifier file
in CSharp.
A new access modifier file
has been added in CSharp 11.
file class fileScopeTest
{
}
@UPIMMUNITY
file
can't be set to another color. Since its' scope value is a variable.
All characters's scope value is given by VSCode. You can check them by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (Mac) and selecting Inspect Editor Tokens and Scopes.
Yes, the build-in themes opened Semantic Highlighting, while Eva Theme doesn't. You can see why in issue 54.
@UPIMMUNITY
You can force open this featrue by setting this option true
.
You can force open this featrue by setting this option
true
.
I misquoted your first reply and I deleted it because it's too long. And accidently deleted my reply again. This is awkward...
Anyway, I have enable this setting however it's not working for this keyword.
It works fine for parameters.
@UPIMMUNITY
Semantic Highlighting doesn't work for
file
on my computer in either build-in themes nor Eva Theme. I guess there is another plug-in affected it in your computer. Please try enable/disable C_pp: Enhanced Colorization, then see it.
@fisheva
Semantic highlighting does work for file
in my computer.
"C_Cpp.enhancedColorization"
it has no effect on this issue.
And I have tried other themes that are not built-in. They all colorize file
when semantic highlighting is enabled.
built-in Dark+
semantic highlighting on
semantic highlighting off
One dark pro
JetBrains Darcula(by Anan)
JetBrains Rider Dark Theme(by Edwin Sulaiman)
@UPIMMUNITY
Semantic highlighting should work for file
in Eva Theme in your computer too. I guess there is another plug-in added semantic scopes value for file
in your computer.
@fisheva
I've tested it in a virtual machine, a totally clean vscode with eva theme and C# extension installed only.
Semantic highlighting still not working for file
.
@UPIMMUNITY
Does semantic highlighting work for file
in build-in themes in the virtual machine ?
If it works, please screenshot its' scopes value. It shows like this in my computer (Doesn't work).
@fisheva
Yes it does work in virtual machine with built-in theme.
@UPIMMUNITY
Still in virtual machine VScode, switch to Eva Theme, then give me a screenshot of file
scopes value. Thx
@fisheva
@UPIMMUNITY
This really confused me. I enabled semantic highlighting, but there is no semantic token type in file
scopes value, either in build-in themes nor in Eva Theme.
Please try the following steps:
1) Turn current theme to Eva Dark.
2) Find the folder where VSCode stores plug-ins. Find Eva Theme folder.
3) Open it, open thems folder, open Eva-Dark.json.
4) Add
, keyword.cs
at the end of the scope property value in line 722.
5) Restart VSCode, enable semantic highlighting, check the scopes value of
file
.
If the above steps still do not work, then only try the ultimate debugging way. Here is my debugging way when I encounter such a situation with unknown reasons and no clue.
1) Turn current theme to Eva Dark.
2) Find the folder where VSCode stores plug-ins. Find Eva Theme folder.
4) Open it, open thems folder, open Eva-Dark.json.
5) Comment some codes, restart VSCode, and see if the display is restored to the initial value. In your case, you need to check whether the scope value of the file is the same as that in the build-in themes after each VSCode restart.
6) Comment half of the code every time. Repeat this process to find out which part of the code affects it.
@fisheva
Now it works
@UPIMMUNITY
Finally! A hard won achievement. Thanks! The process of debugging with you has given me a new understanding of the principle of semantic highlighting.
The file
scopes value has been updated in 1.9.2 version.
@fisheva Well done! My pleasure.
@fisheva
Another issue in latest version.
Colorization for keywords of primitive type and void
in csharp is the same as access modifier.
Obviously it was caused by adding , keywords
in the scope property.
Before update(it is pink)
After update(it is purple)
@UPIMMUNITY Sorry for reply late.
This is why Eva Theme doesn't support Semanti Highlighting yet, which I mentioned in issue 54.
The Semantic Highlighting rule is overlaid on the Syntax Highlighting rule. While, the granularity of Semantic Highlighting is not as exact as Syntax Highlighting. One Semantic Highlighting rule can often cover multiple Syntax Highlighting rules.
By the way, why are the scope values in my computer so different from yours, which makes it difficult for me to debug. I have enabled Semantic Hightlighting.
Here is my VSCode version.
@fisheva
My vscode version.
Same in the virtual machine.
@UPIMMUNITY
I'm confused... I uninstall 1.70.0 VSCode. Installed 1.73.1 VSCode, then only installed Microsoft C# and Eva Theme, enabled Semantic Highlighting, there is still no semantic token type in void
and string
scopes value.
At present, you'd better disable Semantic Highlighting to get the best Eva Theme experience, while the keyword file
will not show purple.
Screenshot
Java Case
C# Case which is looking great
Code Snippet
Supplement