Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[semantic][typescript] Highlight Global Variables #89350

Closed
ButchMonkey opened this issue Jan 27, 2020 · 5 comments
Closed

[semantic][typescript] Highlight Global Variables #89350

ButchMonkey opened this issue Jan 27, 2020 · 5 comments
Assignees
Labels
*out-of-scope Posted issue is not in scope of VS Code semantic-tokens Semantic tokens issues typescript Typescript support issues
Milestone

Comments

@ButchMonkey
Copy link

ButchMonkey commented Jan 27, 2020

Ability to be able to have different syntax highlighting for global variables. (Specifically JavaScript, but this would be useful in other language)

For example, here is a screenshot from NetBeans
image

Current behaviour in VSCode
image

Current Global TM Scope
image

@ButchMonkey ButchMonkey changed the title Highlight Global Variables (Scoped syntax highlighting) Highlight Global Variables (Scoped syntax highlighting) [Feature Request] Jan 31, 2020
@aeschli aeschli changed the title Highlight Global Variables (Scoped syntax highlighting) [Feature Request] [typescript] Highlight Global Variables Feb 5, 2020
@aeschli aeschli added typescript Typescript support issues semantic-tokens Semantic tokens issues labels Feb 5, 2020
@aeschli aeschli added this to the February 2020 milestone Feb 5, 2020
@aeschli aeschli changed the title [typescript] Highlight Global Variables [semantic][typescript] Highlight Global Variables Feb 5, 2020
@ButchMonkey
Copy link
Author

To further add -
Essentially "Enhanced colorization for C++" but for Node.js / Javascript (and other popular languages)
So that theme designers can access variable.other.global and variable.other.local

@aeschli
Copy link
Contributor

aeschli commented Feb 23, 2020

The typescript server now marks all local variables.

@aeschli aeschli modified the milestones: February 2020, Backlog Feb 23, 2020
@ButchMonkey
Copy link
Author

ButchMonkey commented Feb 24, 2020

I'm able to get the desired effect using the following rules -

    "editor.tokenColorCustomizationsExperimental": {
        "variable": {
            "fontStyle": "underline",
            "foreground": "#CC6666",
        },
        "variable.local": {
            "fontStyle": "",
            "foreground": "#CC6666",
        },
        "variable.readonly": {
            "fontStyle": "",
            "foreground": "#CC6666",
        }
    }

However, it looks like support.class is being overwritten by the semantic token type.
As far as I'm aware, semantic takes priority over the textmate scopes. Is there a workaround for this?

image

Necro edit for anyone looking for this in the future, I have a more up to date version with better explanation
https://stackoverflow.com/questions/58959094/how-to-highlight-global-variables-in-vscode

@aeschli
Copy link
Contributor

aeschli commented Feb 25, 2020

The request for adding support for library symbol is : #91090

@aeschli aeschli added the *out-of-scope Posted issue is not in scope of VS Code label Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*out-of-scope Posted issue is not in scope of VS Code semantic-tokens Semantic tokens issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

3 participants
@aeschli @ButchMonkey and others