Merge pull request #1271 from Microsoft/taggedSigHelpAtEnd

Fixed bug where tagged templates with a literal adjacent to EOF showed sig help past the end.
This commit is contained in:
Daniel Rosenwasser 2015-02-12 11:37:32 -08:00
commit 3e8babedcf
5 changed files with 46 additions and 2 deletions

View file

@ -295,8 +295,8 @@ module ts.SignatureHelp {
var tagExpression = <TaggedTemplateExpression>templateExpression.parent;
Debug.assert(templateExpression.kind === SyntaxKind.TemplateExpression);
// If we're just after a template tail, don't show signature help.
if (node.kind === SyntaxKind.TemplateTail && position >= node.getEnd() && !(<LiteralExpression>node).isUnterminated) {
// If we're just after a template tail, don't show signature help.
if (node.kind === SyntaxKind.TemplateTail && !isInsideTemplateLiteral(<LiteralExpression>node, position)) {
return undefined;
}

View file

@ -0,0 +1,11 @@
/// <reference path='fourslash.ts' />
//// function foo(strs, ...rest) {
//// }
////
//// /*1*/fo/*2*/o /*3*/`abcd${0 + 1}abcd{1 + 1}`/*4*/ /*5*/
test.markers().forEach(m => {
goTo.position(m.position);
verify.not.signatureHelpPresent();
});

View file

@ -0,0 +1,11 @@
/// <reference path='fourslash.ts' />
//// function foo(strs, ...rest) {
//// }
////
//// /*1*/fo/*2*/o /*3*/`abcd${0 + 1}abcd{1 + 1}abcd`/*4*/ /*5*/
test.markers().forEach(m => {
goTo.position(m.position);
verify.not.signatureHelpPresent();
});

View file

@ -0,0 +1,11 @@
/// <reference path='fourslash.ts' />
//// function foo(strs, ...rest) {
//// }
////
//// /*1*/fo/*2*/o /*3*/``/*4*/ /*5*/
test.markers().forEach(m => {
goTo.position(m.position);
verify.not.signatureHelpPresent();
});

View file

@ -0,0 +1,11 @@
/// <reference path='fourslash.ts' />
//// function foo(strs, ...rest) {
//// }
////
//// /*1*/fo/*2*/o /*3*/`abcd`/*4*/
test.markers().forEach(m => {
goTo.position(m.position);
verify.not.signatureHelpPresent();
});