Closed jasper-greenberg closed 3 years ago
@TestedDog It sounds like you likely disabled semantic highlighting in vscode.
Can you check to see if editor.semanticHighlighting.enabled
is set to true
?
Looks like it was set to configuredByTheme
by default. I tried setting it to true
with no success. Not to mention, I don't recall touching any settings. The only things that I can remember doing between the change was installing ES Lint and splitting my code into two files. Neither of those should've had an effect.
I see.
Yeah, what's odd is the "before" pic you attached is actually not how the theme is set up to work. Only function parameters should be highlighted in the orange color.
The reason that I thought it might have been semantic highlighting is that in that condition, the editor becomes aware that the props
variable is a parameter and can retain the parameter highlighting.
With default highlighting, the editor is not "smart" in that same way so all variable-like things are just highlighted in the foreground color.
Interesting. It was the first picture I found of what it had sort of looked like before. Apologies for any confusion. Regardless, "oldState", which is definitely an argument was highlighted before. Is there anything else I can try?
Unless I'm misunderstanding you, it looks like from your example oldState
is highlighted correctly in the argument scope.
In the other places where oldState
is being used, it isn't in a function argument scope so it highlights it as it would any variable.
I see what you mean. I just went to look to find another example to make sure I'm not seeing things (and because I am unable to reproduce it) and sure enough, nothing I found looked like what I would swear I used to have. Seeing as this is apparently not a feature, is there any way I can add this manually on my end? (I read a post a little while ago where someone was recommended to make a change locally). I really liked it actually. While writing I did notice one last thing.
The variable embed
used to be purple and continued to be every time it was used. However, as you said, this is not a feature. Maybe I really am seeing things. Anyway, thank you, and please let me know if there are any local changes I can make.
That's odd. I just double checked my vscode editor and in an empty js file, my const variables look like this.
Have you tried reinstalling the extension?
I've just tried reinstalling both the theme and VS Code and unfortunately, my code still looks the same.
Edit: I've just had a friend try and it looked like the following. Both orange/initialized arguments as well as purple variables. In case we weren't sure it was local, this I think, is proof.
Hm... Can you try nuking your user settings?
Do you mind telling me how? I have to admit to being quite new at this.
Yeah, it looks like your editor just isn't using semantic highlighting.
Do you mind telling me how? I have to admit to being quite new at this.
You should have a settings.json
file saved in one of these locations (depending on platform). Just rename that file something else and then reload vscode.
Just tried that. My settings now exclusively consist of:
Unfortunately, still no change.
Hm... very strange indeed.
Is your friend also on a Windows machine?
Is your friend also on a Windows machine?
Yep. And I think I mentioned earlier that this used to work and somehow changed at some point. I cannot even begin to think what I could have done that would cause this. Not to mention, it should have been fixed by a fresh install. However, I was signed into my Microsoft account. I might give it another try being signed out, so it doesn't import any old settings.
Success! I logged out of my account as well as deleted any lasting VS Code data. Not sure what did the trick.
Glad to hear. Closing this for now. Open it back up if you notice any other oddities.
Found the problem. Apparently, I was viewing my code in Plaintext instead of JavasScript and when it is in plaintext, semantic highlighting does not appear to work. Figured I'd mention it.
I recently noticed that some of my colors are not behaving like they did just a few hours ago.
Previously, they looked something like this: Notice how "props" is orange and italicized both in the function and as an argument.
Currently, my code looks like this: In this code, "oldState" should be orange and italicized within the function as well, but it isn't.
I can't think of anything that I have done that would affect changing colors. I have also tried uninstalling/reinstalling the theme and restarting VS Code with no success. Additionally, many of my constants that used to be purple are now white as well. Thanks!
Small update: I have tried testing this feature in other, unrelated code and it doesn't seem to be working there either. I seriously doubt there was an update that changed this so I figure it must be on my end. Additionally, nothing is showing up in VS Code outline. I have no idea if that relevant or not but couldn't hurt to share.
P.S. I would be more than happy to include more screenshots or information as needed.