Skip to content

Commit defe33a

Browse files
authored
Do not offer completions for default module member symbol (#55231)
1 parent b87e301 commit defe33a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45463,7 +45463,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4546345463
if (meaning) {
4546445464
source.forEach(symbol => {
4546545465
// Similar condition as in `resolveNameHelper`
45466-
if (!getDeclarationOfKind(symbol, SyntaxKind.ExportSpecifier) && !getDeclarationOfKind(symbol, SyntaxKind.NamespaceExport)) {
45466+
if (!getDeclarationOfKind(symbol, SyntaxKind.ExportSpecifier) && !getDeclarationOfKind(symbol, SyntaxKind.NamespaceExport) && symbol.escapedName !== InternalSymbolName.Default) {
4546745467
copySymbol(symbol, meaning);
4546845468
}
4546945469
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// https://github.com/microsoft/TypeScript/issues/3229
4+
5+
// @filename: index.ts
6+
7+
//// export default function () {}
8+
//// def/*1*/
9+
10+
verify.completions(
11+
{
12+
marker: "1",
13+
includes: [{ name: "default", kind: "keyword", sortText: completion.SortText.GlobalsOrKeywords }],
14+
},
15+
);
16+

0 commit comments

Comments
 (0)