Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
319 views
in Technique[技术] by (71.8m points)

python - VSCode Pylance changed text color

I just installed Pylance on VisualStudioCode, my theme is OneDarkPro.

I can manually set the text color with editor.semanticTokenColorCustomizations in settings.json but I wonder if there is a way to simply keep my previous text color.

This is how my code looked like before installing Pylance:

enter image description here

This is how it looks like now:

enter image description here

question from:https://stackoverflow.com/questions/65939931/vscode-pylance-changed-text-color

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is caused by "Editor semantic highlighting". Please add the following settings to the settings file "settings.json" to turn off semantic highlighting:

"[python]": {
        "editor.semanticHighlighting.enabled": false,
    },

OneDarkPro and Pylance:

enter image description here

Reference: Semantic highlighting colors every variable with same color.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...