Skip to content

Merge user languages from initialization options and include languages #1014

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

Merged
merged 4 commits into from
Jul 10, 2024

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Jul 8, 2024

Before v0.12.x we'd look at the tailwindCSS.includeLanguages setting in the extension, populate the userLanguages 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 no tailwindCSS.includeLanguages setting was present for a given workspace folder. However, it appears that this setting may end up populated and we'd ignore the userLanguages setting altogether when we shouldn't have.

To fix this we're going to merge in the userLanguages setting from the initialization options with the tailwindCSS.includeLanguages setting if present. Any mappings from settings will take precedence over those from the userLanguages 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 the tailwindCSS.includeLanguages setting instead.

Fixes #1002

  • Add tests showing that language mappings are merged rather than replaced
  • Test against the project in the aforementioned issue

@thecrypticace thecrypticace marked this pull request as draft July 8, 2024 21:02
@thecrypticace thecrypticace marked this pull request as ready for review July 10, 2024 20:18
@thecrypticace thecrypticace merged commit abb0f9f into master Jul 10, 2024
@thecrypticace thecrypticace deleted the fix/init-languages-fallback branch July 10, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression between NPM releases 0.0.16 and 0.0.17 — Not working in Neovim
1 participant