Merge user languages from initialization options and include languages #1014
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.
Before v0.12.x we'd look at the
tailwindCSS.includeLanguages
setting in the extension, populate theuserLanguages
initialization option, and start the server. This setup necessitated a restart of the process whenever this setting changed. In v0.12.x we changed this so that we'd request the user's languages from the settings instead from the initiialization options. This allows us to keep the server running even when the settings change.As part of this, for attempted backwards compatability, in v0.12.x (language server v0.0.16+) we'd still look at the
userLanguages
initialization option if it was present and only use it if notailwindCSS.includeLanguages
setting was present for a given workspace folder. However, it appears that this setting may end up populated and we'd ignore theuserLanguages
setting altogether when we shouldn't have.To fix this we're going to merge in the
userLanguages
setting from the initialization options with thetailwindCSS.includeLanguages
setting if present. Any mappings from settings will take precedence over those from theuserLanguages
initialization option.I'm also explicitly warning when the
userLanguages
initialization option is present and noting it as a deprecated feature and telling users to use thetailwindCSS.includeLanguages
setting instead.Fixes #1002