increase classlist search range (#414)

master
Brad Cornes 2021-10-08 17:36:17 +01:00
parent d74a53ae9e
commit 251d32faaf
2 changed files with 5 additions and 5 deletions

View File

@ -334,7 +334,7 @@ async function provideClassAttributeCompletions(
context?: CompletionContext context?: CompletionContext
): Promise<CompletionList> { ): Promise<CompletionList> {
let str = document.getText({ let str = document.getText({
start: document.positionAt(Math.max(0, document.offsetAt(position) - 500)), start: document.positionAt(Math.max(0, document.offsetAt(position) - 1000)),
end: position, end: position,
}) })
@ -400,8 +400,8 @@ async function provideCustomClassNameCompletions(
const positionOffset = document.offsetAt(position) const positionOffset = document.offsetAt(position)
const searchRange: Range = { const searchRange: Range = {
start: document.positionAt(Math.max(0, positionOffset - 500)), start: document.positionAt(Math.max(0, positionOffset - 1000)),
end: document.positionAt(positionOffset + 500), end: document.positionAt(positionOffset + 1000),
} }
let str = document.getText(searchRange) let str = document.getText(searchRange)

View File

@ -379,8 +379,8 @@ export async function findClassNameAtPosition(
let classNames = [] let classNames = []
const positionOffset = doc.offsetAt(position) const positionOffset = doc.offsetAt(position)
const searchRange: Range = { const searchRange: Range = {
start: doc.positionAt(Math.max(0, positionOffset - 500)), start: doc.positionAt(Math.max(0, positionOffset - 1000)),
end: doc.positionAt(positionOffset + 500), end: doc.positionAt(positionOffset + 1000),
} }
if (isCssContext(state, doc, position)) { if (isCssContext(state, doc, position)) {