microsoft / microsoft/TypeScript

Sort jsdoc parameter suggestions by argument position

未关闭 适合新手
#20,183 12 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Domain: LS: Completion Lists Good First Issue Help Wanted Suggestion VS Code Tracked
主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
132

描述

From https://github.com/Microsoft/vscode/issues/35124

TypeScript Version: 2.7.0-dev.20171116

Code

For the code:

/**
 * @param |
 */
function foo(z, a) {}

Trigger completions at the | after @param

Expected behavior:
z is returned first, followed by a. The sortText can be used for this

Actual behavior:
a and z are returned with sort orders weights:

[Trace  - 11:33:07 PM] Sending request: completions (176). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/san/y.ts",
    "line": 2,
    "offset": 11,
    "includeExternalModuleExports": true
}
[Trace  - 11:33:07 PM] Response received: completions (176). Request took 2 ms. Success: true 
Result: [
    {
        "name": "a",
        "kind": "parameter",
        "kindModifiers": "",
        "sortText": "0"
    },
    {
        "name": "z",
        "kind": "parameter",
        "kindModifiers": "",
        "sortText": "0"
    }
]

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 TypeScript language service 中用于 JSDoc @param 建议的补全入口点开始,并复现使用 function foo(z, a) 的示例。调整补全顺序,使参数遵循参数位置,然后验证 z 在 a 之前返回,并且 sortText 反映此顺序。

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

评估

技术栈
typescript
领域
tooling
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
活跃
描述清晰度
描述清楚
新手友好度
72/100

把新 issue 发到你的邮箱

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