Skip to content

Add support for @defaultValue and @typeParam #78

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

Merged
merged 4 commits into from
Oct 2, 2018
Merged
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
4 changes: 4 additions & 0 deletions tsdoc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log - @microsoft/tsdoc

## 0.7.0
- Add support for `@defaultValue` tag
- Add support for `@typeParam` tag

## 0.6.0
- Add support for `@link` tags using the new declaration reference syntax
- Add support for `@inheritDoc` tags
Expand Down
2 changes: 1 addition & 1 deletion tsdoc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/tsdoc",
"version": "0.6.0",
"version": "0.7.0",
"description": "A parser for the TypeScript doc comment syntax",
"keywords": [
"TypeScript",
Expand Down
15 changes: 14 additions & 1 deletion tsdoc/src/__tests__/ParsingBasics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test('01 Simple @beta and @internal extraction', () => {
expect(modifierTagSet.isInternal()).toEqual(true);
});

test('02 A basic TSDoc comment with all components', () => {
test('02 A basic TSDoc comment with common components', () => {
const configuration: TSDocParserConfiguration = new TSDocParserConfiguration();
configuration.addTagDefinitions([
new TSDocTagDefinition({
Expand Down Expand Up @@ -98,3 +98,16 @@ test('03 Incomplete @param blocks', () => {
' */'
].join('\n'));
});

test('04 typeParam blocks', () => {
TestHelpers.parseAndMatchDocCommentSnapshot([
'/**',
' * Constructs a map from a JavaScript object',
' *',
' * @typeParam K - The generic type parameter indicating the key type',
' * @param jsonObject - The input object',
' * @typeParam V - The generic type parameter indicating the value type',
' * @returns The map',
' */'
].join('\n'));
});
44 changes: 26 additions & 18 deletions tsdoc/src/__tests__/__snapshots__/ParagraphSplitter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`01 Basic paragraph splitting 1`] = `
Object {
"_0_lines": Array [
"_00_lines": Array [
"",
"This is the",
"first paragraph.",
Expand All @@ -15,8 +15,8 @@ Object {
"",
"",
],
"_1_gaps": Array [],
"_2_summarySection": Object {
"_01_gaps": Array [],
"_02_summarySection": Object {
"kind": "Section",
"nodes": Array [
Object {
Expand Down Expand Up @@ -96,25 +96,29 @@ Object {
},
],
},
"_3_remarksBlock": undefined,
"_4_customBlocks": Array [],
"_5_paramBlocks": Array [],
"_6_returnsBlock": undefined,
"_7_modifierTags": Array [],
"_8_logMessages": Array [],
"_03_remarksBlock": undefined,
"_04_privateRemarksBlock": undefined,
"_05_deprecatedBlock": undefined,
"_06_paramBlocks": Array [],
"_07_typeParamBlocks": Array [],
"_08_returnsBlock": undefined,
"_09_customBlocks": Array [],
"_10_inheritDocTag": undefined,
"_11_modifierTags": Array [],
"_12_logMessages": Array [],
}
`;

exports[`02 Degenerate paragraph 1`] = `
Object {
"_0_lines": Array [
"_00_lines": Array [
"line 1",
"line 2",
"",
" @public line 3",
],
"_1_gaps": Array [],
"_2_summarySection": Object {
"_01_gaps": Array [],
"_02_summarySection": Object {
"kind": "Section",
"nodes": Array [
Object {
Expand Down Expand Up @@ -161,17 +165,21 @@ Object {
},
],
},
"_3_remarksBlock": undefined,
"_4_customBlocks": Array [],
"_5_paramBlocks": Array [],
"_6_returnsBlock": undefined,
"_7_modifierTags": Array [
"_03_remarksBlock": undefined,
"_04_privateRemarksBlock": undefined,
"_05_deprecatedBlock": undefined,
"_06_paramBlocks": Array [],
"_07_typeParamBlocks": Array [],
"_08_returnsBlock": undefined,
"_09_customBlocks": Array [],
"_10_inheritDocTag": undefined,
"_11_modifierTags": Array [
Object {
"kind": "BlockTag",
"nodeExcerpt": "@public",
},
],
"_8_logMessages": Array [],
"_12_logMessages": Array [],
}
`;

Expand Down
Loading