-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Bug Report
π Search Terms
jsdoc docblock typedef
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
/** @typedef {{foo: 'foo'}} Foo */
function f() {
}
f()π Actual behavior
Whenever JSDoc typedef blocks are followed by a function (or variable) declaration TS attaches that JSDoc to the function and shows typedefs as part of the function's description when its name is hovered.
(The described behavior is old, but the screenshot of v4.3.0-dev is here to show an extra bug with [object Object].)
π Expected behavior
Typedefs shouldn't be attached to subsequent statements.
As @sandersn wrote in #42895 (comment):
Declaration-like jsdocs are incorrectly attached to the following statement. The fix is probably as simple as a filter somewhere -- the compiler itself doesn't care where
@typedefis, only the services layer does -- but I'm not sure which component should do the filtering.
ilogico and awerlogus
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFix AvailableA PR has been opened for this issueA PR has been opened for this issue
