documentation icon indicating copy to clipboard operation
documentation copied to clipboard

@file is applied to following element instead of the file itself

Open Malvineous opened this issue 7 years ago • 1 comments
trafficstars

If you use the @file statement to provide a description for your file in a header, it gets applied as a duplicate block to whichever element comes first in the file.

Example code:

/**
 * @file Example file.
 */

/**
 * Example class.
 */
class Example {
	/**
	 * Example function.
	 */
	a() {
	}
};

Here, the @file block should effectively be ignored, however documentation currently applies it to the following item, so in this case the Example class is duplicated.

I think if a docblock contains @file it should be ignored, or at least attached to the file and not to whatever element follows the block.

Here is the output of the above code, with the duplicate Example class:

### Table of Contents

-   [Example][1]
    -   [a][2]
-   [Example][3]
    -   [a][4]

## Example

Example file.

### a

Example function.

## Example

Example class.

### a

Example function.

[1]: #example

[2]: #a

[3]: #example-1

[4]: #a-1

Running 8.1.2 via CLI.

Malvineous avatar Nov 18 '18 03:11 Malvineous

Same issue. (Although I prefer the alias @fileOverview, for anyone reading this and starting a fix. ☻)

Zearin avatar Feb 09 '20 19:02 Zearin