microsoft / microsoft/vscode

Please add native support for Color Identifiers

Open
#324,835 3 comments 20 reactions 1 assignee Claimed by @aiday-mar View on GitHub
editor-color-picker feature-request
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

There's an excellent extension that implements this functionality:
https://marketplace.visualstudio.com/items?itemName=MatthewNespor.vscode-color-identifiers-mode&ssr=false
this is one of *very* few extensions i use,
and it would be great if such functionality could just be provided natively by the editor.

Functionally, it selects a color for each distinct identifier,
iff identifier's type is configured[^1] to be colored.
For some people, this makes it easier to "see" the code.

Comparison: Extension:

with Color Identifiers

Current (w/o Extension):

w/o Color Identifiers

There's potential to do even smarter coloring:
just because two identifiers are identical,
does not mean they are the same, consider:
```
fn a_name() {}
fn test() -> i32 {
a_name();
let a_name = 0;
a_name
}
```
Function `a_name` and function call `a_name()` should have the same color,
but the variable `a_name` is not and "should" have it's own distinct color.
Not sure if [^1] is enough for this, though.

[^1]: https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#standard-token-types-and-modifiers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.