Skip to content

Commit 251d32f

Browse files
committed
increase classlist search range (#414)
1 parent d74a53a commit 251d32f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/tailwindcss-language-service/src/completionProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ async function provideClassAttributeCompletions(
334334
context?: CompletionContext
335335
): Promise<CompletionList> {
336336
let str = document.getText({
337-
start: document.positionAt(Math.max(0, document.offsetAt(position) - 500)),
337+
start: document.positionAt(Math.max(0, document.offsetAt(position) - 1000)),
338338
end: position,
339339
})
340340

@@ -400,8 +400,8 @@ async function provideCustomClassNameCompletions(
400400
const positionOffset = document.offsetAt(position)
401401

402402
const searchRange: Range = {
403-
start: document.positionAt(Math.max(0, positionOffset - 500)),
404-
end: document.positionAt(positionOffset + 500),
403+
start: document.positionAt(Math.max(0, positionOffset - 1000)),
404+
end: document.positionAt(positionOffset + 1000),
405405
}
406406

407407
let str = document.getText(searchRange)

packages/tailwindcss-language-service/src/util/find.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ export async function findClassNameAtPosition(
379379
let classNames = []
380380
const positionOffset = doc.offsetAt(position)
381381
const searchRange: Range = {
382-
start: doc.positionAt(Math.max(0, positionOffset - 500)),
383-
end: doc.positionAt(positionOffset + 500),
382+
start: doc.positionAt(Math.max(0, positionOffset - 1000)),
383+
end: doc.positionAt(positionOffset + 1000),
384384
}
385385

386386
if (isCssContext(state, doc, position)) {

0 commit comments

Comments
 (0)