Skip to content

Commit b7ca396

Browse files
authored
Merge pull request #2557 from sapphi-red/sort-html-attribute-without-colon
sort attribute suggestion without `:` or `@`
2 parents 6f78f19 + 004acc4 commit b7ca396

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/modes/template/services/htmlCompletion.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,14 @@ export function doComplete(
168168
if ((filterPrefix === ':' && codeSnippet[0] === ':') || (filterPrefix === '@' && codeSnippet[0] === '@')) {
169169
codeSnippet = codeSnippet.slice(1);
170170
}
171+
const trimedName = attribute.replace(/^(?::|@)/, '');
171172
result.items.push({
172173
label: attribute,
173174
kind: type === 'event' ? CompletionItemKind.Function : CompletionItemKind.Value,
174175
textEdit: TextEdit.replace(range, codeSnippet),
175176
insertTextFormat: InsertTextFormat.Snippet,
176-
sortText: priority + attribute,
177+
sortText: priority + trimedName,
178+
filterText: trimedName,
177179
documentation: toMarkupContent(documentation)
178180
});
179181
});

0 commit comments

Comments
 (0)