From 329bb9b38adf4391671bf637a5d8020c00af5241 Mon Sep 17 00:00:00 2001 From: Bugs5382 Date: Wed, 26 Jun 2024 01:48:20 -0400 Subject: [PATCH] Add @description to the default list of recognized tags Resolves TypeStrong#2618 --- CHANGELOG.md | 1 + src/lib/utils/options/tsdoc-defaults.ts | 1 + src/test/converter2/issues/gh2618.ts | 5 +++++ src/test/issues.c2.test.ts | 11 +++++++++++ tsdoc.json | 4 ++++ 5 files changed, 22 insertions(+) create mode 100644 src/test/converter2/issues/gh2618.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index acbb1e840..ba17a7618 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - `mailto:` links are no longer incorrectly recognized as relative paths, #2613. - Added `@since` to the default list of recognized tags, #2614. +- Added `@description` to the default list of recognized tags, #2618 - Relative paths to directories will no longer cause the directory to be copied into the media directory, #2617. ## v0.26.2 (2024-06-24) diff --git a/src/lib/utils/options/tsdoc-defaults.ts b/src/lib/utils/options/tsdoc-defaults.ts index 17a7e23c9..4c97e4ab3 100644 --- a/src/lib/utils/options/tsdoc-defaults.ts +++ b/src/lib/utils/options/tsdoc-defaults.ts @@ -20,6 +20,7 @@ export const blockTags = [ "@category", "@categoryDescription", "@default", + "@description", "@document", "@group", "@groupDescription", diff --git a/src/test/converter2/issues/gh2618.ts b/src/test/converter2/issues/gh2618.ts new file mode 100644 index 000000000..0127c50e3 --- /dev/null +++ b/src/test/converter2/issues/gh2618.ts @@ -0,0 +1,5 @@ +/** + * Foo + * @description Bar + */ +export function foo() {} diff --git a/src/test/issues.c2.test.ts b/src/test/issues.c2.test.ts index bb3866389..d6212e2f9 100644 --- a/src/test/issues.c2.test.ts +++ b/src/test/issues.c2.test.ts @@ -1636,4 +1636,15 @@ describe("Issue Tests", () => { logger.expectNoOtherMessages(); }); + + it("#2618 supports @description tag", () => { + const project = convert(); + const foo = querySig(project, "foo"); + equal( + foo.comment?.getTag("@description"), + new CommentTag("@description", [{ kind: "text", text: "Bar" }]), + ); + + logger.expectNoOtherMessages(); + }); }); diff --git a/tsdoc.json b/tsdoc.json index 9bed22577..cde303d38 100644 --- a/tsdoc.json +++ b/tsdoc.json @@ -75,6 +75,10 @@ "tagName": "@default", "syntaxKind": "block" }, + { + "tagName": "@description", + "syntaxKind": "block" + }, { // TSDoc defines @returns, we also recognize @return for JSDoc compat "tagName": "@return",