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:
commit
3e8babedcf
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
|
@ -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();
|
||||
});
|
|
@ -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();
|
||||
});
|
|
@ -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();
|
||||
});
|
Loading…
Reference in a new issue