Microsoft/TypeScript

Support @class in JSDoc

Open

#12,681 创建于 2016年12月5日

在 GitHub 查看
 (2 评论) (11 反应) (0 负责人)TypeScript (6,726 fork)batch import
Domain: JSDocDomain: JavaScriptHas ReproHelp WantedSuggestionVS Code Tracked

仓库指标

Star
 (48,455 star)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 9 个 PR)

描述

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

贡献者指南