languages: Initialize Tailwind's options with includeLanguages (#43978)

Since [this
PR](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1014),
the `tailwindCSS.userLanguages` option has been deprecated, and it is
recommended to use `tailwindCSS.includeLanguages` instead. Using
`tailwindCSS.userLanguages` triggers the warning shown below in the
`tailwindcss-language-server` logs.

<img width="634" height="259" alt="tailwindcss-language-server (kron)
Server Logs v"
src="https://github.com/user-attachments/assets/763551ad-f41a-4756-9d7d-dfb7df45cc5c"
/>

Release Notes:

- Fixed a warning indicating the deprecation of
`tailwindCSS.userLanguages` by initializing the options with
`tailwindCSS.includeLanguages`.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This commit is contained in:
Afief Abdurrahman
2025-12-09 11:08:29 +05:30
committed by GitHub
co-authored by Smit Barmase
parent 45829b3380
commit ba807a3c46
+11 -8
View File
@@ -140,13 +140,6 @@ impl LspAdapter for TailwindLspAdapter {
) -> Result<Option<serde_json::Value>> {
Ok(Some(json!({
"provideFormatter": true,
"userLanguages": {
"html": "html",
"css": "css",
"javascript": "javascript",
"typescript": "typescript",
"typescriptreact": "typescriptreact",
},
})))
}
@@ -167,8 +160,18 @@ impl LspAdapter for TailwindLspAdapter {
tailwind_user_settings["emmetCompletions"] = Value::Bool(true);
}
if tailwind_user_settings.get("includeLanguages").is_none() {
tailwind_user_settings["includeLanguages"] = json!({
"html": "html",
"css": "css",
"javascript": "javascript",
"typescript": "typescript",
"typescriptreact": "typescriptreact",
});
}
Ok(json!({
"tailwindCSS": tailwind_user_settings,
"tailwindCSS": tailwind_user_settings
}))
}