Expand `classRegex` search range (#840)
parent
5c59d6f59b
commit
47d512edde
|
@ -499,8 +499,8 @@ async function provideCustomClassNameCompletions(
|
|||
const positionOffset = document.offsetAt(position)
|
||||
|
||||
const searchRange: Range = {
|
||||
start: document.positionAt(Math.max(0, positionOffset - 1000)),
|
||||
end: document.positionAt(positionOffset + 1000),
|
||||
start: document.positionAt(0),
|
||||
end: document.positionAt(positionOffset + 2000),
|
||||
}
|
||||
|
||||
let str = document.getText(searchRange)
|
||||
|
|
|
@ -135,7 +135,7 @@ async function findCustomClassLists(
|
|||
|
||||
if (!Array.isArray(regexes) || regexes.length === 0) return []
|
||||
|
||||
const text = doc.getText(range)
|
||||
const text = doc.getText(range ? { ...range, start: doc.positionAt(0) } : undefined)
|
||||
const result: DocumentClassList[] = []
|
||||
|
||||
for (let i = 0; i < regexes.length; i++) {
|
||||
|
|
Loading…
Reference in New Issue