Fix empty jsdoc suggest template not properyly expanding to multiline

Fixes #43619
This commit is contained in:
Matt Bierner 2018-02-16 13:45:32 -08:00
parent d17652218a
commit 57e5420127

View file

@ -170,6 +170,12 @@ class TryCompleteJsDocCommand implements Command {
if (!res || !res.body) {
return undefined;
}
// Workaround for #43619
// docCommentTemplate previously returned undefined for empty jsdoc templates.
// TS 2.7 now returns a single line doc comment, which breaks indentation.
if (res.body.newText === '/** */') {
return undefined;
}
return TryCompleteJsDocCommand.templateToSnippet(res.body.newText);
}, () => undefined);
}