Skip to content

Commit fb9539a

Browse files
author
Brad Cornes
committed
update context completion items
1 parent 1614bd1 commit fb9539a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/tailwindcss-language-server/src/providers/completionProvider.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ function completionsFromClassList(
6666
isIncomplete: false,
6767
items: Object.keys(isSubset ? subset : state.classNames.classNames).map(
6868
(className) => {
69+
let label = className
6970
let kind: CompletionItemKind = CompletionItemKind.Constant
7071
let documentation: string = null
72+
let command: any
7173
if (isContextItem(state, [...subsetKey, className])) {
7274
kind = CompletionItemKind.Module
75+
command = { title: '', command: 'editor.action.triggerSuggest' }
76+
label += state.separator
7377
} else {
7478
const color = getColor(state, [className])
7579
if (color) {
@@ -79,12 +83,13 @@ function completionsFromClassList(
7983
}
8084

8185
return {
82-
label: className,
86+
label,
8387
kind,
8488
documentation,
89+
command,
8590
data: [...subsetKey, className],
8691
textEdit: {
87-
newText: className,
92+
newText: label,
8893
range: replacementRange,
8994
},
9095
}

0 commit comments

Comments
 (0)