Skip to content

Commit 7462fa9

Browse files
committed
fix(typescript-plugin): exclude items of kind module from template completion
1 parent 0d5c7eb commit 7462fa9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/typescript-plugin/lib/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function getCompletionsAtPosition<T>(
8888
]);
8989

9090
if (ranges.some(([start, end]) => position >= start && position <= end)) {
91+
const globalKinds = new Set(['var', 'function', 'module']);
9192
const globalsOrKeywords = (ts as any).Completions.SortText.GlobalsOrKeywords;
9293
const sortTexts = new Set([
9394
globalsOrKeywords,
@@ -97,7 +98,7 @@ function getCompletionsAtPosition<T>(
9798

9899
result.entries = result.entries.filter(entry =>
99100
!(entry.kind === 'const' && entry.name in vueOptions.macros) && (
100-
entry.kind !== 'var' && entry.kind !== 'function'
101+
!globalKinds.has(entry.kind)
101102
|| !sortTexts.has(entry.sortText)
102103
|| isGloballyAllowed(entry.name)
103104
)

0 commit comments

Comments
 (0)