Pylance-release: The semantic coloring of local variables becomes gray

Created on 5 Apr 2021  Â·  10Comments  Â·  Source: microsoft/pylance-release

Environment data

  • Language Server version: Pylance language server v2021.3.5pre.1
  • OS and version: Windows_NT x64 10.0.19043
  • Python version: Python 3.8.6

Expected behaviour

The semantic coloring of local variables should be red.

Actual behaviour

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

waiting for upstream

Most helpful comment

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.

  • Language Server version: Pylance language server v2021.3.4
  • OS and version: macOS 11.2.3
  • Python version: Python 3.8.5

All 10 comments

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?

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

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.

  • Language Server version: Pylance language server v2021.3.4
  • OS and version: macOS 11.2.3
  • Python version: Python 3.8.5

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

@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 [email protected]

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.

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

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

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

@Binaryify 感谢!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ynouri picture ynouri  Â·  3Comments

PedroMDuarte picture PedroMDuarte  Â·  5Comments

DannyNemer picture DannyNemer  Â·  3Comments

ciaranjudge picture ciaranjudge  Â·  3Comments

savannahostrowski picture savannahostrowski  Â·  4Comments