Support custom modifiers via BlockSchema
& LabelSchema
#106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The LSP spec is not explicit in saying that custom token types or modifiers are supported, but it does neither explicitly say it's forbidden.
The fact that the underlying type for both is a
string
and that there is relatively detailed corresponding client/server capability available suggests this is possible.The expectation is that downstream LS (
terraform-ls
) would use the client capability to see what token modifiers the client actually supports before offering them any custom ones and it would continue providing fallback, just like terraform-ls does today:https://github.com/hashicorp/terraform-ls/blob/2de83c81f9e53457b943efaf0801acf6185b71b3/internal/lsp/token_encoder.go#L37-L86
The benefit is that clients which do support more specific token types and modifiers can use those - which in turn enables more specific themes that can take advantage of these. Clients which do not support these will continue to use the fallback types & modifiers. So basically - everyone's happy? 😄 🤞🏻
Related: hashicorp/vscode-terraform#958