Skip to content

Commit

Permalink
feat: add option to support intellisense for non-scoped css
Browse files Browse the repository at this point in the history
close #1038
  • Loading branch information
johnsoncodehk committed Mar 20, 2022
1 parent 3462c8d commit 4a070e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Expand Up @@ -27,6 +27,10 @@
"experimentalDisableTemplateSupport": {
"type": "boolean",
"markdownDescription": "https://github.com/johnsoncodehk/volar/issues/577"
},
"experimentalRsolveNonScopedCssClasses": {
"type": "boolean",
"markdownDescription": "https://github.com/johnsoncodehk/volar/issues/1038"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/vue-typescript/src/types.ts
Expand Up @@ -20,4 +20,5 @@ export interface VueCompilerOptions {
experimentalTemplateCompilerOptions?: any;
experimentalTemplateCompilerOptionsRequirePath?: string;
experimentalDisableTemplateSupport?: boolean;
experimentalRsolveNonScopedCssClasses?: boolean;
}
2 changes: 1 addition & 1 deletion packages/vue-typescript/src/use/useSfcTemplateScript.ts
Expand Up @@ -45,7 +45,7 @@ export function useSfcTemplateScript(
const cssScopedClasses = computed(() => {
const obj: Record<string, Record<string, TextRange[]>> = {};
for (const style of styleFiles.value) {
if (style.data.scoped) {
if (style.data.scoped || compilerOptions.experimentalRsolveNonScopedCssClasses) {
const classes = getCssClasses(style);
obj[style.fileName] = classes;
}
Expand Down

0 comments on commit 4a070e6

Please sign in to comment.