Skip to content

Commit 1cc33b4

Browse files
committed
fix: show namespaces with leading slash
1 parent cf7346b commit 1cc33b4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/completion/xml/NamespaceCompletionProvider.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,19 @@ export class NamespaceCompletionProvider extends XmlSuggestionProvider<Completio
5555
return [];
5656
}
5757

58+
const startsWithBackslash = value.startsWith('\\');
59+
60+
if (startsWithBackslash) {
61+
value = value.replace(/^\\/, '');
62+
}
63+
5864
const completions = namespaceIndexData.findNamespacesByPrefix(value);
5965

6066
return completions.map(namespace => {
61-
const item = new CompletionItem(namespace.fqn, CompletionItemKind.Value);
67+
const item = new CompletionItem(
68+
startsWithBackslash ? `\\${namespace.fqn}` : namespace.fqn,
69+
CompletionItemKind.Value
70+
);
6271
item.range = range;
6372
return item;
6473
});

0 commit comments

Comments
 (0)