Microsoft/TypeScript

Support @class in JSDoc

Offen

#12.681 geöffnet am 05.12.2016

 (2 Kommentare) (11 Reaktionen) (0 zugewiesene Personen)TypeScript (13.395 Forks)batch import
Domain: JSDocDomain: JavaScriptHas ReproHelp WantedSuggestionVS Code Tracked

Repository-Metriken

Stars
 (108.860 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

From https://github.com/Microsoft/vscode/issues/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

Contributor Guide