-
-
Notifications
You must be signed in to change notification settings - Fork 406
[feat] syntactic semantic tokens #4672
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
Conversation
e6621bc
to
1bde91a
Compare
Some keypoints beyond the tokens retrieval:
- UTF8 vs UTF16 differences for the token range between haskell and LSP spec. see
focusTokenAt
. - Consider position mappings so we have correct highlighting even the file could not even parse, see
toCurrentRange
. - we need to consider delta between each result, see
semanticTokensFullDelta
. This is to minimize the bandwith between LSP server and clients.
Post it here as a reminder.
Thank you. I will go through all of these.
plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Internal.hs
Outdated
Show resolved
Hide resolved
plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Internal.hs
Outdated
Show resolved
Hide resolved
Use the GHC AST and lsp semantic tokens to convince the language server to give highlighting even without any editor highlighting plugins.
1bde91a
to
bc4ed9a
Compare
plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Internal.hs
Outdated
Show resolved
Hide resolved
@soulomoon I'm currently struggling a bit with the tests - the ASTs are different enough that making the syntax highlighting consistent between ghc versions is probably a big pain. Should I introduce more goldens for all supported ghc versions?
also stylish-haskell
's parser seems to be confused about the CPP :/
@soulomoon I'm currently struggling a bit with the tests - the ASTs are different enough that making the syntax highlighting consistent between ghc versions is probably a big pain. Should I introduce more goldens for all supported ghc versions?
The only different should be that module name in the head is included since 9.10?
Uh oh!
There was an error while loading. Please reload this page.
Use the GHC AST and lsp semantic tokens to convince the language server to give highlighting even without any editor highlighting plugins.
Fixes #4501