Skip to content

Commit

Permalink
Add @description to the default list of recognized tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Bugs5382 committed Jun 26, 2024
1 parent da4f8fd commit 329bb9b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/options/tsdoc-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const blockTags = [
"@category",
"@categoryDescription",
"@default",
"@description",
"@document",
"@group",
"@groupDescription",
Expand Down
5 changes: 5 additions & 0 deletions src/test/converter2/issues/gh2618.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* Foo
* @description Bar
*/
export function foo() {}
11 changes: 11 additions & 0 deletions src/test/issues.c2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
4 changes: 4 additions & 0 deletions tsdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
"tagName": "@default",
"syntaxKind": "block"
},
{
"tagName": "@description",
"syntaxKind": "block"
},
{
// TSDoc defines @returns, we also recognize @return for JSDoc compat
"tagName": "@return",
Expand Down

0 comments on commit 329bb9b

Please sign in to comment.