-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Implement semantic tokens plugin to support semantic highlighting(textDocument/semanticTokens/full) #3892
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
… as by instance deriving) being handled
…stable across different ghc versions
…elopment.IDE.GHC.Error
sure, I'll collect them some times later |
To avoid performance degradation |
Sure, I can take a look at them in the near future to see if I could be helpful. |
plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Mappings.hs
Outdated
Show resolved
Hide resolved
Could you make this disabled by default, like the stan plugin here? #3917 I think given how big and new this is it's sensible to do that for one release and get some testing. Then I think this is close to being mergeable. I don't know if there's more tidying you want to do - maybe a bit more documentation/cleaning up commented out code etc. And we should remember to make issues for the bits of future work you have in mind. |
Yep, Plugin is off by default now and tidying is done.
definitely, I will open issues to track them down. |
track list have been made in #3931 |
it seems a [Required] test is failling accidentally. Maybe it need to be rerun @michaelpj
|
Working out #1654
specification: specification
motivation
It enhance the original syntax highlighting by differing tokens semanticly.
What is implemented
we need to store last computed tokens for files in Ide state. I will try to implement them in the future after getting a deeper understanding of how hls works.
Features:
Supported PluginMethodHandler
Supported semantic tokens type:
pattern bindingsIn favor of differing functions and none-functions from its typevalue bindingsIn favor of differing functions and none-functions from its typeSupported modifiers(planning):
Support unicode
Implementation details:
NameSemanticMap
for imported and top level name tokens usingHscEnv
(with deps) and type checked resultNameSemanticMap
usingRefMap a
from the result ofGetHieAst
(Name, Span)
in current module, in turn compute their semantic token using the combination map of the above twoNameSemanticMap
The focus of this implementation of semantic tokens is to support semantic highlight.
modifiers does not seems to provided as much use in pure language as in impure language.
I decided to ignore the modifier support for now, and schedule to the future.
Ps
I am using the following configuration to test the stuff out in vscode.