diff --git a/src/services/services.ts b/src/services/services.ts index 3fea33a40dd..4c5fb5ce679 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2654,10 +2654,11 @@ module ts { return undefined; } - // Find the node where completion is requested on, in the case of a completion after a dot, it is the member access expression - // other wise, it is a request for all visible symbols in the scope, and the node is the current location - let node: Node; - let isRightOfDot: boolean; + // Find the node where completion is requested on, in the case of a completion after + // a dot, it is the member access expression other wise, it is a request for all + // visible symbols in the scope, and the node is the current location. + let node = currentToken; + let isRightOfDot = false; if (previousToken && previousToken.kind === SyntaxKind.DotToken && previousToken.parent.kind === SyntaxKind.PropertyAccessExpression) { node = (previousToken.parent).expression; isRightOfDot = true; @@ -2666,10 +2667,6 @@ module ts { node = (previousToken.parent).left; isRightOfDot = true; } - else { - node = currentToken; - isRightOfDot = false; - } // Clear the current activeCompletionSession for this session activeCompletionSession = {