update context completion items

master
Brad Cornes 2020-04-27 22:14:47 +01:00
parent 1614bd1eed
commit fb9539ac46
1 changed files with 7 additions and 2 deletions

View File

@ -66,10 +66,14 @@ function completionsFromClassList(
isIncomplete: false, isIncomplete: false,
items: Object.keys(isSubset ? subset : state.classNames.classNames).map( items: Object.keys(isSubset ? subset : state.classNames.classNames).map(
(className) => { (className) => {
let label = className
let kind: CompletionItemKind = CompletionItemKind.Constant let kind: CompletionItemKind = CompletionItemKind.Constant
let documentation: string = null let documentation: string = null
let command: any
if (isContextItem(state, [...subsetKey, className])) { if (isContextItem(state, [...subsetKey, className])) {
kind = CompletionItemKind.Module kind = CompletionItemKind.Module
command = { title: '', command: 'editor.action.triggerSuggest' }
label += state.separator
} else { } else {
const color = getColor(state, [className]) const color = getColor(state, [className])
if (color) { if (color) {
@ -79,12 +83,13 @@ function completionsFromClassList(
} }
return { return {
label: className, label,
kind, kind,
documentation, documentation,
command,
data: [...subsetKey, className], data: [...subsetKey, className],
textEdit: { textEdit: {
newText: className, newText: label,
range: replacementRange, range: replacementRange,
}, },
} }