Skip to content

Commit 2971cf2

Browse files
committed
Make sure language specific settings are passed to the language server
1 parent b8ba251 commit 2971cf2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

packages/vscode-tailwindcss/src/extension.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,23 @@ export async function activate(context: ExtensionContext) {
493493
workspace: {
494494
configuration: (params) => {
495495
return params.items.map(({ section, scopeUri }) => {
496-
let scope: ConfigurationScope | null = scopeUri ? Uri.parse(scopeUri) : null
496+
let scope: ConfigurationScope | null = null
497+
498+
if (scopeUri) {
499+
let uri = Uri.parse(scopeUri)
500+
let doc = Workspace.textDocuments.find((doc) => doc.uri.toString() === scopeUri)
501+
502+
// Make sure we ask VSCode for language specific settings for
503+
// the document as it does not do this automatically
504+
if (doc) {
505+
scope = {
506+
uri,
507+
languageId: doc.languageId,
508+
}
509+
} else {
510+
scope = uri
511+
}
512+
}
497513

498514
let settings = Workspace.getConfiguration(section, scope)
499515

0 commit comments

Comments
 (0)