Skip to content

Commit a04b6fd

Browse files
rhendrictmcw
authored andcommitted
fix: @name tag disconnects comment (#897)
The previous support for @name tags suppressing inference from surrounding code was ad-hoc and incomplete. This commit makes a @name tag (or a tag acting as a @kind/@name shorthand combo, like @function) detach the `ast` field from the comment context, so that the surrounding code will be universally ignored per the JSDoc spec.
1 parent c94412a commit a04b6fd

File tree

14 files changed

+59
-1441
lines changed

14 files changed

+59
-1441
lines changed

__tests__/__snapshots__/bin.js.snap

+1-22
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ k.isArrayOfBuffers();</pre>
896896
<p>a typedef with nested properties</p>
897897
898898
899-
<div class='pre p1 fill-light mt0'>CustomError(other: any, also: any)</div>
899+
<div class='pre p1 fill-light mt0'>CustomError</div>
900900
901901
902902
@@ -908,27 +908,6 @@ k.isArrayOfBuffers();</pre>
908908
909909
910910
911-
<div class='py1 quiet mt1 prose-big'>Parameters</div>
912-
<div class='prose'>
913-
914-
<div class='space-bottom0'>
915-
<div>
916-
<span class='code bold'>other</span> <code class='quiet'>(any)</code>
917-
918-
</div>
919-
920-
</div>
921-
922-
<div class='space-bottom0'>
923-
<div>
924-
<span class='code bold'>also</span> <code class='quiet'>(any)</code>
925-
926-
</div>
927-
928-
</div>
929-
930-
</div>
931-
932911
933912
934913
<div class='py1 quiet mt1 prose-big'>Properties</div>

__tests__/__snapshots__/test.js.snap

+1-22
Original file line numberDiff line numberDiff line change
@@ -1650,7 +1650,7 @@ k.isArrayOfBuffers();</pre>
16501650
<p>a typedef with nested properties</p>
16511651
16521652
1653-
<div class='pre p1 fill-light mt0'>CustomError(other: any, also: any)</div>
1653+
<div class='pre p1 fill-light mt0'>CustomError</div>
16541654
16551655
16561656
@@ -1662,27 +1662,6 @@ k.isArrayOfBuffers();</pre>
16621662
16631663
16641664
1665-
<div class='py1 quiet mt1 prose-big'>Parameters</div>
1666-
<div class='prose'>
1667-
1668-
<div class='space-bottom0'>
1669-
<div>
1670-
<span class='code bold'>other</span> <code class='quiet'>(any)</code>
1671-
1672-
</div>
1673-
1674-
</div>
1675-
1676-
<div class='space-bottom0'>
1677-
<div>
1678-
<span class='code bold'>also</span> <code class='quiet'>(any)</code>
1679-
1680-
</div>
1681-
1682-
</div>
1683-
1684-
</div>
1685-
16861665
16871666
16881667
<div class='py1 quiet mt1 prose-big'>Properties</div>

__tests__/bin.js

-4
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ test('--config', async function() {
163163
var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString());
164164
fs.mkdirSync(dst);
165165
var outputIndex = path.join(dst, 'index.html');
166-
var expectedOutputPath = path.join(
167-
__dirname,
168-
'fixture/html/nested.config-output.html'
169-
);
170166
const data = await documentation(
171167
[
172168
'build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' +

0 commit comments

Comments
 (0)