Skip to content

Commit 12ae0b4

Browse files
committed
fix: @name tag disconnects comment
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 2df7d3e commit 12ae0b4

File tree

14 files changed

+62
-1442
lines changed

14 files changed

+62
-1442
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
@@ -1601,7 +1601,7 @@ k.isArrayOfBuffers();</pre>
16011601
<p>a typedef with nested properties</p>
16021602
16031603
1604-
<div class='pre p1 fill-light mt0'>CustomError(other: any, also: any)</div>
1604+
<div class='pre p1 fill-light mt0'>CustomError</div>
16051605
16061606
16071607
@@ -1613,27 +1613,6 @@ k.isArrayOfBuffers();</pre>
16131613
16141614
16151615
1616-
<div class='py1 quiet mt1 prose-big'>Parameters</div>
1617-
<div class='prose'>
1618-
1619-
<div class='space-bottom0'>
1620-
<div>
1621-
<span class='code bold'>other</span> <code class='quiet'>(any)</code>
1622-
1623-
</div>
1624-
1625-
</div>
1626-
1627-
<div class='space-bottom0'>
1628-
<div>
1629-
<span class='code bold'>also</span> <code class='quiet'>(any)</code>
1630-
1631-
</div>
1632-
1633-
</div>
1634-
1635-
</div>
1636-
16371616
16381617
16391618
<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)