Rename parameter

This commit is contained in:
Yui T
2015-12-10 11:42:20 -08:00
parent 0c699ad474
commit 03c8d2f293
3 changed files with 11 additions and 9 deletions

View File

@@ -14576,7 +14576,7 @@ namespace ts {
return false;
}
function getSymbolsInScope(location: Node, meaning: SymbolFlags, includeAllGlobalSymbols: boolean): Symbol[] {
function getSymbolsInScope(location: Node, meaning: SymbolFlags, includeGlobalSymbols: boolean): Symbol[] {
const symbols: SymbolTable = {};
let memberFlags: NodeFlags = 0;
@@ -14639,7 +14639,7 @@ namespace ts {
location = location.parent;
}
if (includeAllGlobalSymbols) {
if (includeGlobalSymbols) {
copySymbols(globals, meaning);
}
}

View File

@@ -1717,7 +1717,7 @@ namespace ts {
getBaseTypes(type: InterfaceType): ObjectType[];
getReturnTypeOfSignature(signature: Signature): Type;
getSymbolsInScope(location: Node, meaning: SymbolFlags, includeAllGlobalSymbols: boolean): Symbol[];
getSymbolsInScope(location: Node, meaning: SymbolFlags, includeGlobalSymbols: boolean): Symbol[];
getSymbolAtLocation(node: Node): Symbol;
getShorthandAssignmentValueSymbol(location: Node): Symbol;
getTypeAtLocation(node: Node): Type;

View File

@@ -3114,9 +3114,11 @@ namespace ts {
}
else if (isRightOfOpenTag) {
let tagSymbols = typeChecker.getJsxIntrinsicTagNames();
// If the currect cursor is inside JSX opening tag, the only meaningful completions are those of JSX.IntrinsicElements or users defined React.Component
// If the services can't find those symbols, then show nothing instead of including all the global symbols in the completion list.
if (tryGetGlobalSymbols(/*includeAllGlobalSymbols*/false)) {
// 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)) {
symbols = tagSymbols.concat(symbols.filter(s => !!(s.flags & SymbolFlags.Value)));
}
else {
@@ -3140,7 +3142,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(/*includeAllGlobalSymbols*/true)) {
if (!tryGetGlobalSymbols(/*includeGlobalSymbols*/ true)) {
return undefined;
}
}
@@ -3200,7 +3202,7 @@ namespace ts {
}
}
function tryGetGlobalSymbols(includeAllGlobalSymbols: boolean): boolean {
function tryGetGlobalSymbols(includeGlobalSymbols: boolean): boolean {
let objectLikeContainer: ObjectLiteralExpression | BindingPattern;
let namedImportsOrExports: NamedImportsOrExports;
let jsxContainer: JsxOpeningLikeElement;
@@ -3271,7 +3273,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, includeAllGlobalSymbols);
symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings, includeGlobalSymbols);
return true;
}