Skip to content

Commit 086dfb4

Browse files
committed
Fix missing parameter
1 parent 0b2db09 commit 086dfb4

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

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

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export function completionsFromClassList(
4343
state: State,
4444
classList: string,
4545
classListRange: Range,
46+
document: TextDocument,
4647
filter?: (item: CompletionItem) => boolean,
47-
document?: TextDocument,
4848
context?: CompletionContext
4949
): CompletionList {
5050
let classNamesAndWhitespace = classList.split(/(\s+)/)
@@ -489,8 +489,8 @@ async function provideClassAttributeCompletions(
489489
),
490490
end: position,
491491
},
492-
undefined,
493492
document,
493+
undefined,
494494
context
495495
)
496496
}
@@ -553,13 +553,18 @@ async function provideCustomClassNameCompletions(
553553
classList = containerMatch[1].substr(0, cursor - matchStart)
554554
}
555555

556-
return completionsFromClassList(state, classList, {
557-
start: {
558-
line: position.line,
559-
character: position.character - classList.length,
556+
return completionsFromClassList(
557+
state,
558+
classList,
559+
{
560+
start: {
561+
line: position.line,
562+
character: position.character - classList.length,
563+
},
564+
end: position,
560565
},
561-
end: position,
562-
})
566+
document
567+
)
563568
}
564569
}
565570
} catch (_) {}
@@ -599,6 +604,7 @@ function provideAtApplyCompletions(
599604
},
600605
end: position,
601606
},
607+
document,
602608
(item) => {
603609
if (item.kind === 9) {
604610
return (
@@ -1332,13 +1338,18 @@ async function provideEmmetCompletions(
13321338
const parts = emmetItems.items[0].label.split('.')
13331339
if (parts.length < 2) return null
13341340

1335-
return completionsFromClassList(state, parts[parts.length - 1], {
1336-
start: {
1337-
line: position.line,
1338-
character: position.character - parts[parts.length - 1].length,
1341+
return completionsFromClassList(
1342+
state,
1343+
parts[parts.length - 1],
1344+
{
1345+
start: {
1346+
line: position.line,
1347+
character: position.character - parts[parts.length - 1].length,
1348+
},
1349+
end: position,
13391350
},
1340-
end: position,
1341-
})
1351+
document
1352+
)
13421353
}
13431354

13441355
export async function doComplete(

0 commit comments

Comments
 (0)