Handle new JSDoc tag format

This commit is contained in:
Your Name 2021-03-18 19:16:15 +00:00
parent ffd28b299d
commit 64504b9ffb

View file

@ -535,9 +535,9 @@ export class SuggestAdapter extends Adapter implements languages.CompletionItemP
function tagToString(tag: ts.JSDocTagInfo): string {
let tagLabel = `*@${tag.name}*`;
if (tag.name === 'param' && tag.text) {
const [paramName, ...rest] = tag.text.split(' ');
tagLabel += `\`${paramName}\``;
if (rest.length > 0) tagLabel += `${rest.join(' ')}`;
const [paramName, ...rest] = tag.text;
tagLabel += `\`${paramName.text}\``;
if (rest.length > 0) tagLabel += `${rest.map(r => r.text).join(' ')}`;
} else if (tag.text) {
tagLabel += `${tag.text}`;
}