mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Remove includeGlobalSymbol boolean
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
// <d/**/
|
||||
// the completion list should only contain JSX.instrinsicElements or users-defined React.Component
|
||||
// those symbols of JSX.instrinsi
|
||||
if (tryGetGlobalSymbols(/*includeGlobalSymbols*/ false)) {
|
||||
|
||||
if (tryGetGlobalSymbols()) {
|
||||
symbols = tagSymbols.concat(symbols.filter(s => !!(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;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
//// }
|
||||
//// var x1 = <div>
|
||||
//// <h1> Hello world </ /*2*/>
|
||||
//// </ /* 1 * />
|
||||
//// </ /*1*/>
|
||||
|
||||
goTo.marker("1");
|
||||
verify.memberListCount(1);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//@Filename: file.tsx
|
||||
//// var x1 = <div>
|
||||
//// <h1> Hello world </ /*2*/>
|
||||
//// </ /* 1 * />
|
||||
//// </ /*1*/>
|
||||
|
||||
goTo.marker("1");
|
||||
verify.memberListCount(1);
|
||||
|
||||
Reference in New Issue
Block a user