-
-
Notifications
You must be signed in to change notification settings - Fork 369
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 config for semantic-tokens-plugin for mapping from hs token type to LSP default token type #3940
Conversation
Configuration is implemented, @michaelpj @fendor |
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.
The main thing is I think it would be better with one option per mapping, although I'm not sure how to do that. Maybe @fendor knows having looked at the config stuff recently?
plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Internal.hs
Show resolved
Hide resolved
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/Mappings.hs
Outdated
Show resolved
Hide resolved
plugins/hls-semantic-tokens-plugin/hls-semantic-tokens-plugin.cabal
Outdated
Show resolved
Hide resolved
Seems to have an example of enum properties. Looks like each one will need its own descriptions of the enum members, but you can share that on the Haskell side. |
thanks for the link. Switching to this method. |
…SP default token type
…ing the configuration
See if this looks good, I use Enum property for each token type now @michaelpj |
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.
Just some comments about the naming and stuff. I think this does matter since it's user facing so it's worth making sure it's comprehensible to people
@@ -249,6 +249,622 @@ | |||
"scope": "resource", | |||
"type": "boolean" | |||
}, | |||
"haskell.plugin.semanticTokens.config.class": { |
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.
I don't know whether we might want more configuration options later, but perhaps it would be wise to nest all these in config.tokenMapping
or something?
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.
I guess this is the main remaining question. Not sure if it's going to make that much of a difference or not 🤔
I guess the alternative would be to suffix the option name with Token
? So we could have config.classToken
which is relatively clear what it's doing...
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.
I don't know whether we might want more configuration options later, but perhaps it would be wise to nest all these in config.tokenMapping or something?
I think this one would be better. I am going to extend the properties api to better support nested configuration.
{-# LANGUAGE TypeFamilies #-} | ||
{-# LANGUAGE TypeOperators #-} | ||
|
||
module Ide.Plugin.SemanticTokens.SemanticConfig where |
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.
Is this less code than defining them manually? ;) It's only 11 items. Up to you though 🤷
Yeah, the general output looks great |
Sorry, I don't have any insight in the config specification itself |
I think in the short term just suffix-ing the options is fine, e.g. |
Sure, let's fix the name and try to merge this one first. |
Yes, although generally it's better to avoid changing config names since it messes up users |
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.
Nearly there, just a couple of things that shouldn't have been checked in, then I think we can merge.
Has conflicts now |
Test failures seem genuine? |
🤔 fail again I'll take a look |
The merge from master create some problems, need manually fixing. |
It should be fixed now |
This would provide configurability for semantic tokens #3937
Things that is done:
tokenMappings
to config of semantic-token-plugintokenMappings
is workingdefault config for semantic tokens: