mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 20:37:46 -05:00
Fixed bug where tagged templates with a literal adjacent to EOF showed sig help.
This commit is contained in:
@@ -715,7 +715,7 @@ module ts {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function emitEnumDeclaration(node: EnumDeclaration) {
|
||||
if (resolver.isDeclarationVisible(node)) {
|
||||
emitJsDocComments(node);
|
||||
@@ -3558,7 +3558,7 @@ module ts {
|
||||
return leadingComments;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getLeadingCommentsToEmit(node: Node) {
|
||||
// Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments
|
||||
if (node.parent.kind === SyntaxKind.SourceFile || node.pos !== node.parent.pos) {
|
||||
|
||||
@@ -823,9 +823,10 @@ module ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we didn't end in a backtick, we must still be in the middle of a template.
|
||||
// If we did, make sure that it's not the *initial* backtick.
|
||||
return sourceText.charCodeAt(node.end - 1) !== CharacterCodes.backtick || node.text.length === 0;
|
||||
// If we didn't end in a backtick, we must still be in the middle of a template literal,
|
||||
// but if it's the *initial* backtick (whereby the token is 1 char long), then it's unclosed.
|
||||
var width = node.end - getTokenPosOfNode(node);
|
||||
return width < 2 || sourceText.charCodeAt(node.end - 1) !== CharacterCodes.backtick;
|
||||
}
|
||||
|
||||
export function isModifier(token: SyntaxKind): boolean {
|
||||
|
||||
@@ -296,7 +296,7 @@ module ts.SignatureHelp {
|
||||
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() && !isUnterminatedTemplateEnd(<LiteralExpression>node)) {
|
||||
if (node.kind === SyntaxKind.TemplateTail && !isInsideTemplateLiteral(<LiteralExpression>node, position)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user