diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6077e76ed04..16b598ec211 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14576,7 +14576,7 @@ namespace ts { return false; } - function getSymbolsInScope(location: Node, meaning: SymbolFlags, includeGlobalSymbols: boolean): Symbol[] { + function getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[] { const symbols: SymbolTable = {}; let memberFlags: NodeFlags = 0; @@ -14639,9 +14639,7 @@ namespace ts { location = location.parent; } - if (includeGlobalSymbols) { - copySymbols(globals, meaning); - } + copySymbols(globals, meaning); } /** diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 9cec9dda241..0cb182e378b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1717,7 +1717,7 @@ namespace ts { getBaseTypes(type: InterfaceType): ObjectType[]; getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags, includeGlobalSymbols: boolean): Symbol[]; + getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol; getShorthandAssignmentValueSymbol(location: Node): Symbol; getTypeAtLocation(node: Node): Type; diff --git a/src/services/services.ts b/src/services/services.ts index 552af68ce40..6e8aa237f47 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3114,11 +3114,8 @@ namespace ts { } else if (isRightOfOpenTag) { let tagSymbols = typeChecker.getJsxIntrinsicTagNames(); - // In this case, we are handling completion list inside JSX opening tag. For example: - // !!(s.flags & SymbolFlags.Value))); } else { @@ -3142,7 +3139,7 @@ namespace ts { // For JavaScript or TypeScript, if we're not after a dot, then just try to get the // global symbols in scope. These results should be valid for either language as // the set of symbols that can be referenced from this location. - if (!tryGetGlobalSymbols(/*includeGlobalSymbols*/ true)) { + if (!tryGetGlobalSymbols()) { return undefined; } } @@ -3202,7 +3199,7 @@ namespace ts { } } - function tryGetGlobalSymbols(includeGlobalSymbols: boolean): boolean { + function tryGetGlobalSymbols(): boolean { let objectLikeContainer: ObjectLiteralExpression | BindingPattern; let namedImportsOrExports: NamedImportsOrExports; let jsxContainer: JsxOpeningLikeElement; @@ -3273,7 +3270,7 @@ namespace ts { /// TODO filter meaning based on the current context let symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias; - symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings, includeGlobalSymbols); + symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); return true; } diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTag3.ts b/tests/cases/fourslash/tsxCompletionOnClosingTag3.ts index 80d2b0c00ba..a39740df586 100644 --- a/tests/cases/fourslash/tsxCompletionOnClosingTag3.ts +++ b/tests/cases/fourslash/tsxCompletionOnClosingTag3.ts @@ -9,7 +9,7 @@ //// } //// var x1 =
////

Hello world -//// +//// goTo.marker("1"); verify.memberListCount(1); diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTag4.ts b/tests/cases/fourslash/tsxCompletionOnClosingTag4.ts index a36a933127d..04176ba7fcb 100644 --- a/tests/cases/fourslash/tsxCompletionOnClosingTag4.ts +++ b/tests/cases/fourslash/tsxCompletionOnClosingTag4.ts @@ -3,7 +3,7 @@ //@Filename: file.tsx //// var x1 =
////

Hello world -//// +//// goTo.marker("1"); verify.memberListCount(1);