Some renaming and added comments as per feedback

This commit is contained in:
Sheetal Nandi
2014-12-04 12:55:54 -08:00
parent 1939c7f2cd
commit c3c44dc3c8
4 changed files with 30 additions and 18 deletions

View File

@@ -2428,7 +2428,7 @@ module ts {
isMemberCompletion = true;
if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression) {
var symbol = typeInfoResolver.getSymbolInfoOfLocation(node);
var symbol = typeInfoResolver.getSymbolAtLocation(node);
// This is an alias, follow what it aliases
if (symbol && symbol.flags & SymbolFlags.Import) {
@@ -2445,7 +2445,7 @@ module ts {
}
}
var type = typeInfoResolver.getTypeOfLocation(node);
var type = typeInfoResolver.getTypeAtLocation(node);
if (type) {
// Filter private properties
forEach(type.getApparentProperties(), symbol => {
@@ -3089,7 +3089,7 @@ module ts {
displayParts.push(punctuationPart(SyntaxKind.CloseParenToken));
}
else {
var internalAliasSymbol = typeResolver.getSymbolInfoOfLocation(importDeclaration.moduleReference);
var internalAliasSymbol = typeResolver.getSymbolAtLocation(importDeclaration.moduleReference);
if (internalAliasSymbol) {
displayParts.push(spacePart());
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
@@ -3199,7 +3199,7 @@ module ts {
return undefined;
}
var symbol = typeInfoResolver.getSymbolInfoOfLocation(node);
var symbol = typeInfoResolver.getSymbolAtLocation(node);
if (!symbol) {
// Try getting just type at this position and show
switch (node.kind) {
@@ -3209,7 +3209,7 @@ module ts {
case SyntaxKind.ThisKeyword:
case SyntaxKind.SuperKeyword:
// For the identifiers/this/super etc get the type at position
var type = typeInfoResolver.getTypeOfLocation(node);
var type = typeInfoResolver.getTypeAtLocation(node);
if (type) {
return {
kind: ScriptElementKind.unknown,
@@ -3326,7 +3326,7 @@ module ts {
return undefined;
}
var symbol = typeInfoResolver.getSymbolInfoOfLocation(node);
var symbol = typeInfoResolver.getSymbolAtLocation(node);
// Could not find a symbol e.g. node is string or number keyword,
// or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol
@@ -3958,7 +3958,7 @@ module ts {
return getReferencesForSuperKeyword(node);
}
var symbol = typeInfoResolver.getSymbolInfoOfLocation(node);
var symbol = typeInfoResolver.getSymbolAtLocation(node);
// Could not find a symbol e.g. unknown identifier
if (!symbol) {
@@ -4210,7 +4210,7 @@ module ts {
return;
}
var referenceSymbol = typeInfoResolver.getSymbolInfoOfLocation(referenceLocation);
var referenceSymbol = typeInfoResolver.getSymbolAtLocation(referenceLocation);
if (referenceSymbol) {
var referenceSymbolDeclaration = referenceSymbol.valueDeclaration;
var shorthandValueSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(referenceSymbolDeclaration);
@@ -4443,7 +4443,7 @@ module ts {
function getPropertySymbolFromTypeReference(typeReference: TypeReferenceNode) {
if (typeReference) {
var type = typeInfoResolver.getTypeOfLocation(typeReference);
var type = typeInfoResolver.getTypeAtLocation(typeReference);
if (type) {
var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName);
if (propertySymbol) {
@@ -4967,7 +4967,7 @@ module ts {
// Only walk into nodes that intersect the requested span.
if (node && span.intersectsWith(node.getStart(), node.getWidth())) {
if (node.kind === SyntaxKind.Identifier && node.getWidth() > 0) {
var symbol = typeInfoResolver.getSymbolInfoOfLocation(node);
var symbol = typeInfoResolver.getSymbolAtLocation(node);
if (symbol) {
var type = classifySymbol(symbol, getMeaningFromLocation(node));
if (type) {
@@ -5396,7 +5396,7 @@ module ts {
// Can only rename an identifier.
if (node && node.kind === SyntaxKind.Identifier) {
var symbol = typeInfoResolver.getSymbolInfoOfLocation(node);
var symbol = typeInfoResolver.getSymbolAtLocation(node);
// Only allow a symbol to be renamed if it actually has at least one declaration.
if (symbol && symbol.getDeclarations() && symbol.getDeclarations().length > 0) {

View File

@@ -457,7 +457,7 @@ module ts.SignatureHelp {
var invocation = argumentListInfo.invocation;
var callTarget = getInvokedExpression(invocation)
var callTargetSymbol = typeInfoResolver.getSymbolInfoOfLocation(callTarget);
var callTargetSymbol = typeInfoResolver.getSymbolAtLocation(callTarget);
var callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeInfoResolver, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined);
var items: SignatureHelpItem[] = map(candidates, candidateSignature => {
var signatureHelpParameters: SignatureHelpParameter[];