Skip to content

Commit 8f75353

Browse files
authored
(fix) better autocompletion for global css vars
#521 By making the label contain the `var`-part, it will show up more likely for users.
1 parent 5aaefe1 commit 8f75353

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/language-server/src/plugins/css/CSSPlugin.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,9 @@ export class CSSPlugin
202202
const additionalItems: CompletionItem[] = this.globalVars
203203
.getGlobalVars()
204204
.map((globalVar) => ({
205-
label: globalVar.name,
205+
label: `var(${globalVar.name})`,
206+
sortText: `-`,
206207
detail: `${globalVar.filename}\n\n${globalVar.name}: ${globalVar.value}`,
207-
textEdit: value.textEdit && {
208-
...value.textEdit,
209-
newText: `var(${globalVar.name})`
210-
},
211208
kind: CompletionItemKind.Value
212209
}));
213210
return [...items, ...additionalItems];

0 commit comments

Comments
 (0)