respond to code review comments

This commit is contained in:
Mohamed Hegazy 2014-09-16 17:05:05 -07:00
parent d8b437724d
commit 85ddc35268
2 changed files with 3 additions and 6 deletions

View file

@ -556,9 +556,7 @@ module ts {
if (node.kind === kind) { if (node.kind === kind) {
return node; return node;
} }
else { node = node.parent;
node = node.parent;
}
} }
break; break;
} }

View file

@ -1790,7 +1790,7 @@ module ts {
return false; return false;
} }
function isToken(kind: SyntaxKind) { function isPunctuation(kind: SyntaxKind) {
return (SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation); return (SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation);
} }
@ -1883,7 +1883,7 @@ module ts {
// TODO: this is a hack for now, we need a proper walking mechanism to verify that we have the correct node // TODO: this is a hack for now, we need a proper walking mechanism to verify that we have the correct node
var mappedNode = getNodeAtPosition(sourceFile, TypeScript.end(node) - 1); var mappedNode = getNodeAtPosition(sourceFile, TypeScript.end(node) - 1);
if (isToken(mappedNode.kind)) { if (isPunctuation(mappedNode.kind)) {
mappedNode = mappedNode.parent; mappedNode = mappedNode.parent;
} }
@ -1905,7 +1905,6 @@ module ts {
var containingClass = getAncestor(mappedNode, SyntaxKind.ClassDeclaration); var containingClass = getAncestor(mappedNode, SyntaxKind.ClassDeclaration);
isMemberCompletion = true; isMemberCompletion = true;
if (mappedNode.kind === SyntaxKind.Identifier || mappedNode.kind === SyntaxKind.QualifiedName || mappedNode.kind === SyntaxKind.PropertyAccess) { if (mappedNode.kind === SyntaxKind.Identifier || mappedNode.kind === SyntaxKind.QualifiedName || mappedNode.kind === SyntaxKind.PropertyAccess) {
var symbol = typeInfoResolver.getSymbolInfo(mappedNode); var symbol = typeInfoResolver.getSymbolInfo(mappedNode);
if (symbol && symbol.flags & SymbolFlags.HasExports) { if (symbol && symbol.flags & SymbolFlags.HasExports) {