From b8e0740b41d31be058c1aa9266989472e839d79f Mon Sep 17 00:00:00 2001 From: Sebastian Pahnke Date: Fri, 11 Jun 2021 14:43:04 +0200 Subject: [PATCH 1/2] Build tag text correctly for all tags --- src/languageFeatures.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languageFeatures.ts b/src/languageFeatures.ts index 6abfa74..f84bb1e 100644 --- a/src/languageFeatures.ts +++ b/src/languageFeatures.ts @@ -576,7 +576,7 @@ function tagToString(tag: ts.JSDocTagInfo): string { tagLabel += `\`${paramName.text}\``; if (rest.length > 0) tagLabel += ` — ${rest.map(r => r.text).join(' ')}`; } else if (tag.text) { - tagLabel += ` — ${tag.text}`; + tagLabel += ` — ${tag.text.map(r => r.text).join(' ')}`; } return tagLabel; } From a03a8ba9080182dbb5fa762499c189fc7cf8f0ef Mon Sep 17 00:00:00 2001 From: Sebastian Pahnke Date: Fri, 11 Jun 2021 15:19:48 +0200 Subject: [PATCH 2/2] Handle the case that `tag.text` is a string --- src/languageFeatures.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/languageFeatures.ts b/src/languageFeatures.ts index f84bb1e..db332fa 100644 --- a/src/languageFeatures.ts +++ b/src/languageFeatures.ts @@ -575,8 +575,10 @@ function tagToString(tag: ts.JSDocTagInfo): string { const [paramName, ...rest] = tag.text; tagLabel += `\`${paramName.text}\``; if (rest.length > 0) tagLabel += ` — ${rest.map(r => r.text).join(' ')}`; - } else if (tag.text) { + } else if (Array.isArray(tag.text)) { tagLabel += ` — ${tag.text.map(r => r.text).join(' ')}`; + } else if (tag.text) { + tagLabel += ` — ${tag.text}`; } return tagLabel; }