Skip to content

Commit 70becf9

Browse files
authored
Autocomplete from keyword in export declarations (microsoft#56029)
1 parent 6e9ac5b commit 70becf9

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/services/completions.ts

+5
Original file line numberDiff line numberDiff line change
@@ -5654,6 +5654,11 @@ function getImportStatementCompletionInfo(contextToken: Node, sourceFile: Source
56545654
}
56555655
return undefined;
56565656
}
5657+
if (isExportDeclaration(parent) && contextToken.kind === SyntaxKind.AsteriskToken || isNamedExports(parent) && contextToken.kind === SyntaxKind.CloseBraceToken) {
5658+
isKeywordOnlyCompletion = true;
5659+
keywordCompletion = SyntaxKind.FromKeyword;
5660+
return undefined;
5661+
}
56575662
if (isImportKeyword(contextToken) && isSourceFile(parent)) {
56585663
// A lone import keyword with nothing following it does not parse as a statement at all
56595664
keywordCompletion = SyntaxKind.TypeKeyword;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
//// export * /*1*/;
4+
//// export {} /*2*/;
5+
6+
verify.completions({
7+
marker: ["1", "2"],
8+
includes: [{
9+
name: "from",
10+
sortText: completion.SortText.GlobalsOrKeywords,
11+
}],
12+
});

0 commit comments

Comments
 (0)