-
-
Notifications
You must be signed in to change notification settings - Fork 750
Description
- I have checked issues with bug label and found no duplicates
Expected Behavior
@param and @returns should ignore up to two characters of leading whitespace between a * beginning a comment line and an @ beginning a javadoc annotation.
(Or, at the bare minimum, there should be a boldface warning in the docs and some kind of lint so such a subtle typo can't slip in unnoticed.)
Actual Behavior
When I tried to use @param and @returns to document function signatures in interface declarations, I kept getting them passing through as literals.
I wound up utterly convinced that there was a bug in the aspect of the parser which dealt with what subset of javadoc comments were supported and it was only while minimizing the testcase to report it here that I realized it wasn't actually a case of "@param and @returns are broken inside interface definitions" but rather the leading space I'd added so they visually lined up with the text on the /** line.
Steps to reproduce the bug
- Install TypeDoc on top of Using TypeScript 3.7.4 (what I got when I asked npm for the latest versions)
- Put the following in
test.tsin an empty folder:
interface TestInterface {
/** Function description
*
* @param scope Test description.
* @returns Test description.
*/
testFunc(scope: string): boolean;
}- Run
rm -rf docs; typedoc --out docs test.tswith the working directory set to the folder containingtest.ts.
Backspacing away one character of whitespace before each @ will result in it working, but you have to know to do that and it's easy for it to slip back in if something like Vim is handling indentation and line-wrapping within comments.
Environment
- Typedoc version: 0.16.1
- Node.js version: v8.16.0
- OS: Kbuntu 16.04.6 LTS