From ad084ded72cbfcf2ae581a333a5731cf22dacf1f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 17 Mar 2015 08:07:40 -0700 Subject: [PATCH] Account for typeof expressions, added test. --- src/services/utilities.ts | 4 +++- .../completionListInUnclosedIndexSignature01.ts | 1 - .../completionListInUnclosedIndexSignature03.ts | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 tests/cases/fourslash/completionListInUnclosedIndexSignature03.ts diff --git a/src/services/utilities.ts b/src/services/utilities.ts index ca047414e59..679a97449ec 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -160,8 +160,10 @@ module ts { } return isCompletedNode((n).statement, sourceFile); + case SyntaxKind.TypeOfExpression: + return isCompletedNode((n).expression, sourceFile); case SyntaxKind.PrefixUnaryExpression: - return isCompletedNode(n, sourceFile); + return isCompletedNode((n).operand, sourceFile); case SyntaxKind.BinaryExpression: return isCompletedNode((n).right, sourceFile); case SyntaxKind.ConditionalExpression: diff --git a/tests/cases/fourslash/completionListInUnclosedIndexSignature01.ts b/tests/cases/fourslash/completionListInUnclosedIndexSignature01.ts index fd2e5664f04..0667742d4cb 100644 --- a/tests/cases/fourslash/completionListInUnclosedIndexSignature01.ts +++ b/tests/cases/fourslash/completionListInUnclosedIndexSignature01.ts @@ -5,7 +5,6 @@ //// [foo: string]: typeof /*1*/ ////} - goTo.marker("1"); verify.completionListContains("foo"); verify.completionListContains("C"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListInUnclosedIndexSignature03.ts b/tests/cases/fourslash/completionListInUnclosedIndexSignature03.ts new file mode 100644 index 00000000000..bb4ef808bff --- /dev/null +++ b/tests/cases/fourslash/completionListInUnclosedIndexSignature03.ts @@ -0,0 +1,10 @@ +/// + + +////class C { +//// [foo: string]: { x: typeof /*1*/ +////} + +goTo.marker("1"); +verify.completionListContains("foo"); +verify.completionListContains("C"); \ No newline at end of file