Skip to content

provide more semantic token information + refactor and fixes#1103

Merged
leecannon merged 8 commits into
zigtools:masterfrom
Techatrix:refactor-semantic-tokens
May 21, 2023
Merged

provide more semantic token information + refactor and fixes#1103
leecannon merged 8 commits into
zigtools:masterfrom
Techatrix:refactor-semantic-tokens

Conversation

@Techatrix

@Techatrix Techatrix commented Mar 31, 2023

Copy link
Copy Markdown
Member

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"

@leecannon

leecannon commented Mar 31, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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

None yet

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