microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.71k stars 767 forks source link

The semantic coloring of local variables becomes gray #1127

Closed zhiyiYo closed 3 years ago

zhiyiYo commented 3 years ago

Environment data

Expected behaviour

The semantic coloring of local variables should be red.

Actual behaviour

The semantic coloring of local variables is gray. 很奇怪

Jay206-Programmer commented 3 years ago

I can confirm this, It's happening with me as well.

It is happening with the One Dark Pro theme. The theme's semantic highlighting was working properly till yesterday, but it's all messed up right now.

2021-04-05 16_43_52-preprocessing py - end-to-end-p1 - Visual Studio Code

All these variables used to be in the red color previously.

Also, the semantic highlighting seems to be working perfectly for other languages,

2021-04-05 16_49_09-Register js - Feasta_React_Django-master - Visual Studio Code

is it some configuration bug?

zhiyiYo commented 3 years ago

@Jay206-Programmer I quite agree with you. I updated the one dark pro this morning, and that's what happened.

ITProKyle commented 3 years ago

I can confirm that this was caused by the changes in One Dark Pro theme >= 3.10.8.

Installing version 3.10.7 of the theme resolves the issue. How to install another version of an extension.

zhiyiYo commented 3 years ago

@ITProKyle image Unfortunately, the install another version menu option has been disabled

ITProKyle commented 3 years ago

@zhiyiYo - that's odd because I just used it on Visual Studio Code version 1.55.0 which is the latest version. There is a CLI command you can run that should do the same.

code --install-extension zhuangtongfa.material-theme@3.10.7
jakebailey commented 3 years ago

This appears to have been a deliberate decision by the One Dark Pro theme: https://github.com/Binaryify/OneDark-Pro/compare/3.10.7...3.10.9

image

Note that we are still sending the semantic info to VS Code.

I'm not sure why they chose the colors they did; it's inconsistent with other languages, as you've seen.

There's not really anything we can do about this. If you think this was a mistake I can only suggest filing an issue or commenting on the theme's repo.

jakebailey commented 3 years ago

It seems like the change was to "fix" the theme to make it look more like default VS Code, which only looked the way it did because it didn't have any tokenization and didn't apply any colors to variables by default (arguably an oversight).

If this bugs you, you can revert in the UI here (as opposed to using the CLI):

image

zhiyiYo commented 3 years ago

@jakebailey @ITProKyle Thank you for your suggestions. I've moved one dark Pro back to version 3.10.7

Binaryify commented 3 years ago

v3.10.10 had already fix this problem, please confirm if this fixed @zhiyiYo

zhiyiYo commented 3 years ago

@Binaryify 感谢!