From 7a9e163f2e4396fbda3990ccd479998e32ccabaa Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Mon, 1 Jul 2024 21:01:01 -0400 Subject: [PATCH 1/2] Make sure language specific settings are passed to the language server --- packages/vscode-tailwindcss/src/extension.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/vscode-tailwindcss/src/extension.ts b/packages/vscode-tailwindcss/src/extension.ts index 13b0fd9e..cd673305 100755 --- a/packages/vscode-tailwindcss/src/extension.ts +++ b/packages/vscode-tailwindcss/src/extension.ts @@ -493,7 +493,23 @@ export async function activate(context: ExtensionContext) { workspace: { configuration: (params) => { return params.items.map(({ section, scopeUri }) => { - let scope: ConfigurationScope | null = scopeUri ? Uri.parse(scopeUri) : null + let scope: ConfigurationScope | null = null + + if (scopeUri) { + let uri = Uri.parse(scopeUri) + let doc = Workspace.textDocuments.find((doc) => doc.uri.toString() === scopeUri) + + // Make sure we ask VSCode for language specific settings for + // the document as it does not do this automatically + if (doc) { + scope = { + uri, + languageId: doc.languageId, + } + } else { + scope = uri + } + } let settings = Workspace.getConfiguration(section, scope) From 7afedc0770ac9176be916e3e04049aa194d12267 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Mon, 1 Jul 2024 21:05:57 -0400 Subject: [PATCH 2/2] Update changelog --- packages/vscode-tailwindcss/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vscode-tailwindcss/CHANGELOG.md b/packages/vscode-tailwindcss/CHANGELOG.md index 47f9436b..caff8e99 100644 --- a/packages/vscode-tailwindcss/CHANGELOG.md +++ b/packages/vscode-tailwindcss/CHANGELOG.md @@ -2,7 +2,8 @@ ## Prerelease -- Fix detection of v3 insiders builds ([#1007](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1007)) +- Fix detection of v3 insiders builds ([#1007](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1007)) +- Make sure language-specific settings are passed to our language server ([#1006](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1006)) ## 0.12.3