update context completion items
parent
1614bd1eed
commit
fb9539ac46
|
@ -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,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue