Open
Description
Semantic highlighting would give us a great experience on reading the code. It's been a shame that haskell does not have it for all these times. But now we are going to make it happen for haskell in HLS. (Thank @michaelpj for his pull request that support it in lsp package), first version of semantic tokens have been made in this pull request. (Thank @michaelpj @wz1000 for all the help and reviews. )
But since the amount of works it need , not everything in the LSP semantic tokens specification is supported yet, we would do them step by step.
Here is the track list of features.
- provide configuration to map between the semantic tokens type and lsp standard tokens. add config for semantic-tokens-plugin for mapping from hs token type to LSP default token type #3940
- support module name and split out module name in qualified name #3957
- provide configurability to the priorities of hs semantic token types Semantic tokens make tokens types priority configurable #4042
- Support semantic tokens type: done in Implement semantic tokens plugin to support semantic highlighting(textDocument/semanticTokens/full) #3892
- class and class method type family name (data family)
- data constructor name (not distinguishing record and normal data, and GADT)
- type constructor name (GADT)
- record field name
- type synonym
- pattern synonym
- functions
- none-function variables
- infix operator Semantic Tokens: Distinguish (possibly-partially-applied) infix operators from normal functions/variables #3969
- Support PluginMethodHandler
- Support modifiers:
- declaration (as in class declearations, type definition and type family)
- definition (as in class instance declaration, left hand side value binding, and type family instance)
- modification (as in rec field update)
- recursion analyze in let binding Mark recursive references in let bindings #2902
- Support unicode, done in Implement semantic tokens plugin to support semantic highlighting(textDocument/semanticTokens/full) #3892
- Support imported name, done in Implement semantic tokens plugin to support semantic highlighting(textDocument/semanticTokens/full) #3892
- ClientCapabilities,
multilineTokenSupport, overlappingTokenSupport
- highlight identifiers in doc, but not the first line of nested comment due to a ghc bug. https://gitlab.haskell.org/ghc/ghc/-/issues/24378
- Bug fixing & minor improvement: