问题
In Visual Studio Code, is it possible to have different local variables be colored differently? Here's an example from a Medium article of what this looks like:
And one from PyCharm:
This is usually called "semantic highlighting" or "semantic coloring", although VS Code uses that to mean syntax highlighting that more intelligently detects whether a word is a regular variable, function, etc. and color that accordingly.
My question here is basically the same as this 2015 GitHub issue that was wrongly closed as a duplicate of an unrelated issue.
I'd be interested in settings or extensions that work for any languages, though particularly Python or JavaScript/TypeScript.
来源:https://stackoverflow.com/questions/61473510/color-different-variables-differently-in-vs-code