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

provide more semantic token information + refactor and fixes #1103

Merged
merged 8 commits into from
May 21, 2023

Conversation

Techatrix
Copy link
Member

@Techatrix Techatrix commented Mar 31, 2023

these changes had a visible effect depending on the theme used:

  • whether or not something is a namespace, struct, union, etc. is now set with a TokenType instead of TokenModifiers
  • container fields that are named after a keyword were previously highlighted like an identifier

fixes #843

Here is how the above changed have affected highlighting.

Before After
VS-Code "Default Dark+" VS-Code "Default Dark+"
VS-Code "Monokai" VS-Code "Monokai"
Sublime Text 4 "Default Dark" Sublime Text 4 "Default Dark"

@Techatrix Techatrix added the pr:fuzz Attach to a PR to start fuzzing / continually fuzz (please do this before merging!) label Mar 31, 2023
@leecannon
Copy link
Member

leecannon commented Mar 31, 2023

Few things that don't seem quite right.

These four should all have the same color (also happened to notice that #445 doesn't work any more)
image

Its weird that both usages of var_stdout have the same color but the same is not true of const_stdout
image

Edit: Okay, with the first one it seems like the color is due to whether zls is able to resolve the reference or not (std is resolved, builtin is not) as actually adding a module module changes its color to match std.

@Techatrix Techatrix force-pushed the refactor-semantic-tokens branch 2 times, most recently from 0df3c1b to 1f401ec Compare May 8, 2023 21:08
@Techatrix
Copy link
Member Author

I've reverted the change about marking const declarations readonly and it now looks more consistent even though a bit less colorful.

@Techatrix Techatrix force-pushed the refactor-semantic-tokens branch from 93eaa6f to 5cc7b13 Compare May 21, 2023 19:51
@leecannon leecannon merged commit af65197 into zigtools:master May 21, 2023
@Techatrix Techatrix deleted the refactor-semantic-tokens branch May 30, 2023 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:fuzz Attach to a PR to start fuzzing / continually fuzz (please do this before merging!)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

semantic_tokens: Normal comments don't get evaluated if they are alone
2 participants