Skip to content

Commit

Permalink
fix: @name tag disconnects comment (#897)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rhendric authored and tmcw committed Sep 4, 2017
1 parent c94412a commit a04b6fd
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 1,441 deletions.
23 changes: 1 addition & 22 deletions __tests__/__snapshots__/bin.js.snap
Expand Up @@ -896,7 +896,7 @@ k.isArrayOfBuffers();</pre>
<p>a typedef with nested properties</p>
<div class='pre p1 fill-light mt0'>CustomError(other: any, also: any)</div>
<div class='pre p1 fill-light mt0'>CustomError</div>
Expand All @@ -908,27 +908,6 @@ k.isArrayOfBuffers();</pre>
<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>
<div class='space-bottom0'>
<div>
<span class='code bold'>other</span> <code class='quiet'>(any)</code>
</div>
</div>
<div class='space-bottom0'>
<div>
<span class='code bold'>also</span> <code class='quiet'>(any)</code>
</div>
</div>
</div>
<div class='py1 quiet mt1 prose-big'>Properties</div>
Expand Down
23 changes: 1 addition & 22 deletions __tests__/__snapshots__/test.js.snap
Expand Up @@ -1650,7 +1650,7 @@ k.isArrayOfBuffers();</pre>
<p>a typedef with nested properties</p>
<div class='pre p1 fill-light mt0'>CustomError(other: any, also: any)</div>
<div class='pre p1 fill-light mt0'>CustomError</div>
Expand All @@ -1662,27 +1662,6 @@ k.isArrayOfBuffers();</pre>
<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>
<div class='space-bottom0'>
<div>
<span class='code bold'>other</span> <code class='quiet'>(any)</code>
</div>
</div>
<div class='space-bottom0'>
<div>
<span class='code bold'>also</span> <code class='quiet'>(any)</code>
</div>
</div>
</div>
<div class='py1 quiet mt1 prose-big'>Properties</div>
Expand Down
4 changes: 0 additions & 4 deletions __tests__/bin.js
Expand Up @@ -163,10 +163,6 @@ test('--config', async function() {
var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString());
fs.mkdirSync(dst);
var outputIndex = path.join(dst, 'index.html');
var expectedOutputPath = path.join(
__dirname,
'fixture/html/nested.config-output.html'
);
const data = await documentation(
[
'build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' +
Expand Down

0 comments on commit a04b6fd

Please sign in to comment.