Microsoft/TypeScript

@typedef tags appearing in the next declaration quick info in VSCode

Open

#25,303 建立於 2018年6月28日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)TypeScript (48,455 star) (6,726 fork)batch import
BugDomain: JSDocHelp Wanted

描述

TypeScript Version: 2.9.2 / 3.0.0-dev.20180628

Search Terms: jsdoc esdoc typedef vscode quick info function variable next description

I am experiencing an issue in Visual Studio Code where @typedef tags in .js files all get added to the next declaration, whether it be a function, a variable etc. I searched the wiki and the issues about it and found closed issues that experienced the same bug. VSCode was running TypeScript version 2.9.2. I also replicated the bug by upgrading to the latest preview version. It seems this issue was resolved long ago and I can't understand why I am still experiencing it. Here is some familiar code from issue #12233 :

Code

/**
 * @typedef {Object} MyType1
 * @prop {string} name
 * @prop {string} type
 */

/**
 * @typedef {Object} MyType2
 * @prop {string} name
 * @prop {string} type
 */

/**
 * @param {MyType1} param1 MyParamPype
 * @returns {boolean}
 */
function MyFunc1 (param1) {

}

/**
 * @param {MyType2} param2 MyParamPype
 * @returns {boolean}
 */
function MyFunc2 (param1) {

}

Expected behavior: The quick info window when hovering MyFunc1should only show

@param {MyType1} param1 MyParamPype
@returns

Actual behavior: image image

Related Issues: #12233 #12004

貢獻者指南