Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @description to the default list of recognized tags #2619

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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