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

Use Token Modifier to set editorUnnecessaryCode.opacity through SemanticTokens API #92157

Closed
pgfearo opened this issue Mar 6, 2020 · 4 comments
Labels
feature-request Request for new features or functionality semantic-tokens Semantic tokens issues

Comments

@pgfearo
Copy link

pgfearo commented Mar 6, 2020

When using the proposed Semantic Tokens API #86415 , I'd like to be able to use a Token Modifier to de-emphasize variable or function Token Types in the code open in the active editor that aren't being used.

From the Semantic Tokens API Documentation there doesn't seem to be a way to do this.

I'm proposing we have have a specific 'unnecessary' Token Modifier and then have a way to style this with a semanticTokenStyleDefaults 'opacity' property setting.

@vscodebot
Copy link

vscodebot bot commented Mar 6, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@alexdima alexdima assigned aeschli and unassigned alexdima Mar 6, 2020
@alexdima alexdima added feature-request Request for new features or functionality semantic-tokens Semantic tokens issues labels Mar 6, 2020
@vscodebot vscodebot bot added this to the Backlog Candidates milestone Mar 6, 2020
@vscodebot
Copy link

vscodebot bot commented Mar 6, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@alexdima
Copy link
Member

alexdima commented Mar 6, 2020

Both semantic tokens and diagnostics are semantic code annotations, and they result in the color changing, but at this time the only API we have for setting this is via diagnostics that have the tag DiagnosticTag.Unnecessary.

I am not in favor of adding competing API that gives two distinct ways to achieve the same effect.

Diagnostics are established, and are used also for code fixes, which can participate on save, show lightbulbs, and a custom message. Also, diagnostics can show in the problem panel when a severity of at least warning is used.

@pgfearo
Copy link
Author

pgfearo commented Mar 6, 2020

@alexdima Thanks, I wasn't aware of the Diagnostics API as an alternative. In light of this, I'm happy to close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality semantic-tokens Semantic tokens issues
Projects
None yet
Development

No branches or pull requests

3 participants