From 7119165bd0313917ce647e46a8e34cebccc09927 Mon Sep 17 00:00:00 2001 From: Guillaume Salles Date: Sun, 12 Apr 2015 16:04:32 -0400 Subject: [PATCH] Fix issue #2677 : Labels should not get quick info --- src/services/services.ts | 4 ++++ tests/cases/fourslash/noQuickInfoForLabel.ts | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/cases/fourslash/noQuickInfoForLabel.ts diff --git a/src/services/services.ts b/src/services/services.ts index 19fcb46552c..748141dcf55 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3798,6 +3798,10 @@ module ts { // Try getting just type at this position and show switch (node.kind) { case SyntaxKind.Identifier: + if(isLabelName(node)){ + return undefined; + } + // Fall through. case SyntaxKind.PropertyAccessExpression: case SyntaxKind.QualifiedName: case SyntaxKind.ThisKeyword: diff --git a/tests/cases/fourslash/noQuickInfoForLabel.ts b/tests/cases/fourslash/noQuickInfoForLabel.ts new file mode 100644 index 00000000000..16ae6ef5f61 --- /dev/null +++ b/tests/cases/fourslash/noQuickInfoForLabel.ts @@ -0,0 +1,11 @@ +/// + +//// /*1*/label : while(true){ +//// break /*2*/label; +//// } + +goTo.marker('1'); +verify.not.quickInfoExists(); + +goTo.marker('2'); +verify.not.quickInfoExists();