Skip to content

Commit 0bacf61

Browse files
committed
fix: cleanup interpolated values label and sort last
1 parent 0f2016a commit 0bacf61

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/language-service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ const baseSort: NonNullable<MatchSorterOptions<CompletionToken>['baseSort']> = (
8080
return -1
8181
}
8282

83+
// Sort interpolated values last
84+
if (a.value.endsWith('-') && !b.value.endsWith('-')) {
85+
return 1
86+
}
87+
88+
if (!a.value.endsWith('-') && b.value.endsWith('-')) {
89+
return -1
90+
}
91+
8392
return collator.compare(a.label, b.label)
8493
}
8594

src/twind.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@ export class Twind {
601601
prefix,
602602
createCompletionToken(prefix, {
603603
raw: directive,
604-
label: directive,
605604
interpolation: value as CompletionToken['interpolation'],
606605
}),
607606
)

0 commit comments

Comments
 (0)