microsoft / microsoft/TypeScript
JSDoc @this/@lends/@namespace tags are ignored inside Object
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
MyElement.d.ts
declare class MyElement {
constructor(target: Element);
target: Element
}
MyElement.js
@this on globally defined function works as expected, Ctrl+Space shows the correct type of target - Element!

@this before function in the object doesn't take into account!

@lends before the object itself is also not taken into account!

the same with @namespace

I couldn't find the way to point the correct "this" type for function in objects.
VS Code version: Code 1.42.0 (ae08d5460b5a45169385ff3fd44208f431992451, 2020-02-06T10:51:33.119Z)
OS version: Darwin x64 19.3.0
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_renderer: disabled_off surface_control: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | 1, 1, 1 |
| Memory (System) | 32.00GB (7.02GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 0% |
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
MyElement.d.ts と MyElement.js のスニペットを使って動作を再現し、グローバル関数の場合と関数およびオブジェクトレベルのタグを比較します。VS Code の補完の基盤となる JSDoc の処理を検証し、その後、オブジェクト内で @this、@lends、@namespace が認識され、Ctrl+Space が期待される型を報告することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- developer-experience, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100