Skip to content

Commit f4b0e54

Browse files
Make sure language specific settings are passed to the language server (#1006)
* Make sure language specific settings are passed to the language server * Update changelog
1 parent 2c981a3 commit f4b0e54

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

packages/vscode-tailwindcss/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Prerelease
44

5-
- Fix detection of v3 insiders builds ([#1007](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1007))
5+
- Fix detection of v3 insiders builds ([#1007](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1007))
6+
- Make sure language-specific settings are passed to our language server ([#1006](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1006))
67

78
## 0.12.3
89

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)