microsoft / microsoft/TypeScript
Function's attached JSDoc is not preserved when using OmitThisParameter
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Bug Report
🔎 Search Terms
JSDoc, types with docs, preserve docs, OmitThisParameter, bind, inherit description
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about "Something to do with
this" and "Strong typing ofFunctionmemberscall/bind/apply"
⏯ Playground Link
Playground link with relevant code
💻 Code
/**
* This description is lost
*
* @param p As well as this decription
*/
function func(this: {}, p: string): void {}
const f = func as OmitThisParameter<typeof func>;
const g = func.bind({});
🙁 Actual behavior
Hovering over f (or g) shows the type but not the descriptions that were attached to func.
🙂 Expected behavior
f and g to inherit the descriptions of func.
Clarification
The problem mainly lies with OmitThisParameter as bind's declaration uses it.
I'm also not sure if this is considered a bug or a missing feature, so I apologize in advance if this is not the right way to report it.
Might be related to #50715
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供されている Playground の再現から始め、OmitThisParameter がどのように宣言され、func に適用されているかを調べます。これには、それを使用している bind の宣言も含まれます。f と g にカーソルを合わせたときに func の説明と @param ドキュメントが保持され、関連する #50715 の議論に照らして既存の動作が確認されれば、Issue は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100