Skip to content

Support @class in JSDoc #12681

Open
Open
@mjbvz

Description

@mjbvz

From microsoft/vscode#15168

For the following JavaScript code:

/**
 * @class
 * 
 * @param {number} x
 */
function Foo(x) {
    this.x = x
}

/**
 * @param {Foo} foo
 */
const request = function(foo) {

}

The @class jsdoc annotation for Foo does not seem to be recognized, so the type of foo in request is any:

screen shot 2016-12-05 at 3 25 07 pm

Changing the code to use class fixes the issue (you don't actually need the @class in this case):

screen shot 2016-12-05 at 3 26 45 pm

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: JSDocRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosHelp WantedYou can do thisSuggestionAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions