-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
Add basic semantic tokens implementation #3099
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! What functionality does this provide to the user?
It would be best to open an issue to discuss new features before implementing them as there's no guarantee we can accept any particular change.
Sorry, I'm a bit confused. It looks like it broke your syntax highlighting? |
This is using the latest released vscode-gleam, not my syntax. |
I think it shows function values versus other values in different colours |
In the after screenshot it seems to inconsistently highlight variables, and not all the keywords are highlighted any more. That aside, what does this enable for the programmer? |
I believe the main point is that information about the types of values can be used for highlighting (depending on how your theme handles this information), but this is also useful for basic highlighting in some editors which support it, such as KDE's Kate. If correctly done, this can be pretty valuable. |
We have an existing AST visitor implementation here: https://github.com/gleam-lang/gleam/blob/main/compiler-core/src/ast/visit.rs |
This pr adds an ast visitor and a semantic token implementation for
{module}.{label}
{tuple}.{label}
{tuple}.{index}
{record}.{label}
let x = 9
)