Expand `classRegex` search range (#840)

master
Brad Cornes 2023-08-16 17:03:36 +01:00 committed by GitHub
parent 5c59d6f59b
commit 47d512edde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -499,8 +499,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 - 1000)), start: document.positionAt(0),
end: document.positionAt(positionOffset + 1000), end: document.positionAt(positionOffset + 2000),
} }
let str = document.getText(searchRange) let str = document.getText(searchRange)

View File

@ -135,7 +135,7 @@ async function findCustomClassLists(
if (!Array.isArray(regexes) || regexes.length === 0) return [] 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[] = [] const result: DocumentClassList[] = []
for (let i = 0; i < regexes.length; i++) { for (let i = 0; i < regexes.length; i++) {