use character-base ranges when looking for classes
parent
3d6e9b7e4d
commit
79a3f2b5a1
|
@ -306,7 +306,7 @@ function provideClassAttributeCompletions(
|
|||
context?: CompletionContext
|
||||
): CompletionList {
|
||||
let str = document.getText({
|
||||
start: { line: Math.max(position.line - 10, 0), character: 0 },
|
||||
start: document.positionAt(Math.max(0, document.offsetAt(position) - 500)),
|
||||
end: position,
|
||||
})
|
||||
|
||||
|
|
|
@ -360,9 +360,10 @@ export async function findClassNameAtPosition(
|
|||
position: Position
|
||||
): Promise<DocumentClassName> {
|
||||
let classNames = []
|
||||
const searchRange = {
|
||||
start: { line: Math.max(position.line - 10, 0), character: 0 },
|
||||
end: { line: position.line + 10, character: 0 },
|
||||
const positionOffset = doc.offsetAt(position)
|
||||
const searchRange: Range = {
|
||||
start: doc.positionAt(Math.max(0, positionOffset - 500)),
|
||||
end: doc.positionAt(positionOffset + 500),
|
||||
}
|
||||
|
||||
if (isCssContext(state, doc, position)) {
|
||||
|
|
Loading…
Reference in New Issue