microsoft / microsoft/TypeScript

Hover documentation for parameters documented with jsdoc renders improperly

未关闭
#63,573 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Experience Enhancement Suggestion
主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
132

描述

### 🔎 Search Terms

parameter hover documentation
jsdoc parameter hyphen
jsdoc parameter
vscode jsdoc parameter hover

### 🕗 Version & Regression Information

~~- This changed between versions ______ and _______~~
~~- This changed in commit or PR _______~~
- This is the behavior in every version I tried, and I reviewed the entire FAQ for anything that might be related to this
- I was unable to test this on prior versions because this is not a regression in typescript itself, it is a VSCode issue which I know, based on experience, will get moved to this repository.

### ⏯ Playground Link

Won't show vscode hover, so not worth pasting.

### 💻 Code

issue 1:
```ts
/**
* Foo method
* @param arg - Documentation for arg
*/
function ex1(arg: string) {
return arg;
}
```

issue 2:
```ts
/**
* Foo method
*
* @param arg Documentation for arg but it ends up being long enough that we
* must split it across lines to stay within max column width
* @param arg2 Documentation for arg but it ends up being long enough that we must split it across lines to stay within max column width
*/
function ex2(arg: string) {
return arg;
}
```

### 🙁 Actual behavior

Issue 1

The hover doc shows a bullet point when the hyphen is present (note the hover for the method itself renders properly)

Image

Issue 2

Image

### 🙂 Expected behavior

Issue 1

In example 1: The hover for `arg` should match what it does when there is no hyphen:

Image

Issue 2:

The description for arg1 should appear exactly as arg2 does.

### Additional information about the issue

Issue #61603 identified the first issue, but framed it as a bug related to not supporting TSDoc. Since jsdoc explicitly mentions the [optional hyphen](https://jsdoc.app/tags-param), this is not an issue specific to TSdoc. TypeScript support in VSCode should render this properly.

贡献指南

打开贡献指南

调研方向

在 VS Code 中重现两个 TypeScript/JSDoc 示例,并检查参数文档的悬停渲染路径。比较带连字符的描述和换行后的描述;完成标准是可选连字符不会创建非预期的项目符号,并且换行后的 @param 文本的渲染方式与未换行的参数描述相同。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, typescript, vscode
领域
developer-experience, tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。