tweak opacity modifier completions
parent
cf7bb68e35
commit
388cbb8351
|
@ -70,6 +70,7 @@ export function completionsFromClassList(
|
||||||
(context.triggerKind === 2 && context.triggerCharacter === '/')) &&
|
(context.triggerKind === 2 && context.triggerCharacter === '/')) &&
|
||||||
partialClassName.includes('/')
|
partialClassName.includes('/')
|
||||||
) {
|
) {
|
||||||
|
// opacity modifiers
|
||||||
let beforeSlash = partialClassName.split('/').slice(0, -1).join('/')
|
let beforeSlash = partialClassName.split('/').slice(0, -1).join('/')
|
||||||
let testClass = beforeSlash + '/[0]'
|
let testClass = beforeSlash + '/[0]'
|
||||||
let { rules } = jit.generateRules(state, [testClass])
|
let { rules } = jit.generateRules(state, [testClass])
|
||||||
|
@ -94,21 +95,14 @@ export function completionsFromClassList(
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
label: opacity,
|
label: className,
|
||||||
detail: stringifyConfigValue(opacities[opacity]),
|
|
||||||
documentation,
|
documentation,
|
||||||
kind,
|
kind,
|
||||||
sortText: naturalExpand(index),
|
sortText: naturalExpand(index),
|
||||||
data: [className],
|
data: [className],
|
||||||
textEdit: {
|
textEdit: {
|
||||||
newText: opacity,
|
newText: className,
|
||||||
range: {
|
range: replacementRange,
|
||||||
...replacementRange,
|
|
||||||
start: {
|
|
||||||
...replacementRange.start,
|
|
||||||
character: replacementRange.start.character + beforeSlash.length + 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue