Skip to content

Semantic highlighting #8

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

Closed
bentsherman opened this issue Jun 16, 2024 · 2 comments · Fixed by #92
Closed

Semantic highlighting #8

bentsherman opened this issue Jun 16, 2024 · 2 comments · Fixed by #92

Comments

@bentsherman
Copy link
Member

The vscode extension currently uses a TextMate grammar to do syntax highlighting with regular expressions. This works well enough and is fast.

The LSP also allows for semantic tokens i.e. semantic highlighting, which can be used to distinguish between different types of tokens. For example, a "name" could be a type, function, parameter, local variable, object field/method, etc, which requires semantic (i.e. AST) information to determine.

IMO this would be a minor improvement and I'm concerned about the potential performance impact, but I would support it as an optional feature. It should be easy to implement because I think the language server only needs to return a list of tokens and their semantic type, which can be ripped from the AST.

@bentsherman
Copy link
Member Author

Just realized the big use case for semantic highlighting would be to highlight the task scripts (Bash, Python, etc), which should be possible with AST info.

@ewels
Copy link
Member

ewels commented Sep 16, 2024

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 a pull request may close this issue.

2 participants