Merge pull request #81 from spahnke/deprecated-hover-fix

Build tag text correctly for all tags
This commit is contained in:
Alexandru Dima 2021-06-11 15:27:15 +02:00 committed by GitHub
commit dda62a58b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -575,6 +575,8 @@ function tagToString(tag: ts.JSDocTagInfo): string {
const [paramName, ...rest] = tag.text; const [paramName, ...rest] = tag.text;
tagLabel += `\`${paramName.text}\``; tagLabel += `\`${paramName.text}\``;
if (rest.length > 0) tagLabel += `${rest.map(r => r.text).join(' ')}`; if (rest.length > 0) tagLabel += `${rest.map(r => r.text).join(' ')}`;
} else if (Array.isArray(tag.text)) {
tagLabel += `${tag.text.map(r => r.text).join(' ')}`;
} else if (tag.text) { } else if (tag.text) {
tagLabel += `${tag.text}`; tagLabel += `${tag.text}`;
} }