microsoft / microsoft/TypeScript
JSDoc @type completion not working inside function argument
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
### 🔎 Search Terms
jsdoc, completion
### 🕗 Version & Regression Information
Never seems to have worked
### ⏯ Playground Link
_No response_
### 💻 Code
JSDoc has some completion issues with completions like this:
```js
function someFunc(/** @type {^cursor here^} **/) {}
```
❌ Does not work - `@type` completion (in function argument) from `@import` with named argument
```
///
// @allowJS: true
// @checkJs: true
// @module: esnext
// @filename: ./a.ts
////export interface ABC {}
// @filename: ./b.js
/////** @import * as t from "./a" */
////function someFunc(/** @type {t./**/} */arg) {}
verify.completions({
marker: "",
includes: "ABC",
});
```
✅ Works - `@type` completion (in function argument) from `@typedef` and with named argument
```
///
// @allowJS: true
// @checkJs: true
// @module: esnext
// @filename: ./b.js
/////** @typedef {number} SomeNumber */
////function someFunc(/** @type {S/**/} */arg) {}
verify.completions({
marker: "",
includes: "SomeNumber",
});
```
✅ Works - `@type` completion (not part of function argument) from `@import` completion inside
```
///
// @allowJS: true
// @checkJs: true
// @module: esnext
// @filename: ./a.ts
////export interface ABC {}
// @filename: ./b.js
/////** @import * as t from "./a" */
/////** @type {t./**/} */
verify.completions({
marker: "",
includes: "ABC",
});
```
❌ Does not work - `@type` completion (in function argument) from `@import` (argument not named yet)
```
///
// @allowJS: true
// @checkJs: true
// @module: esnext
// @filename: ./a.ts
////export interface ABC {}
// @filename: ./b.js
/////** @import * as t from "./a" */
////function someFunc(/** @type {t./**/} */) {}
verify.completions({
marker: "",
includes: "ABC",
});
```
❌ Does not work - `@type` completion (in function argument) `@typedef` (argument not named yet)
```
///
// @allowJS: true
// @checkJs: true
// @module: esnext
// @filename: ./b.js
/////** @typedef {number} SomeNumber */
////function someFunc(/** @type {S/**/} */) {}
verify.completions({
marker: "",
includes: "SomeNumber",
});
```
### 🙁 Actual behavior
See above, completions are missing.
### 🙂 Expected behavior
See above, completions are present.
### Additional information about the issue
_No response_
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
issue 内の fourslash.ts の再現コードから始め、特に関数引数内で JSDoc @type を使用している仮想 b.js のケースを確認してください。これらの JSDoc 型式に対する TypeScript language service の completion 処理を追跡し、動作している @typedef のケースおよびスタンドアロンのケースと比較してください。完了の条件は、欠落しているケースで ABC と SomeNumber の completions が回帰テストでカバーされることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- developer-experience, tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100