diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 09668541b9..3eb1756992 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -556,9 +556,7 @@ module ts { if (node.kind === kind) { return node; } - else { - node = node.parent; - } + node = node.parent; } break; } diff --git a/src/services/services.ts b/src/services/services.ts index b33d673357..f93631fc4b 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1790,7 +1790,7 @@ module ts { return false; } - function isToken(kind: SyntaxKind) { + function isPunctuation(kind: SyntaxKind) { 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 var mappedNode = getNodeAtPosition(sourceFile, TypeScript.end(node) - 1); - if (isToken(mappedNode.kind)) { + if (isPunctuation(mappedNode.kind)) { mappedNode = mappedNode.parent; } @@ -1905,7 +1905,6 @@ module ts { var containingClass = getAncestor(mappedNode, SyntaxKind.ClassDeclaration); isMemberCompletion = true; - if (mappedNode.kind === SyntaxKind.Identifier || mappedNode.kind === SyntaxKind.QualifiedName || mappedNode.kind === SyntaxKind.PropertyAccess) { var symbol = typeInfoResolver.getSymbolInfo(mappedNode); if (symbol && symbol.flags & SymbolFlags.HasExports) {