microsoft / microsoft/TypeScript

Code Completions for Object's keys behave differently in different declaration scenarios

オープン
#42,071 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Awaiting More Feedback Suggestion
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

I tried these code snippets in monaco editor playground
I'm posting it here, as those were reproducible in VsCode too
VsCode Version: 1.52.0
Commit: 940b5f4bb5fa47866a54529ed759d95d09ee80be
Date: 2020-12-10T22:46:53.673Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 17.7.0

  1. When an Object in constructed with some keys and manipulated by some other keys then, those manipulated keys wont find its place in the suggestions ( as a property ). It only comes in suggestion as a literal

Here, key3 is not suggested as property of the object
Screen Shot 2020-12-21 at 1 53 02 PM


  1. When an Object is initialized with an empty object and then if it is reassigned, then only the directly manipulated keys are shown in suggestions

Here, Only key3 is suggested as property of the object and not the other keys
Screen Shot 2020-12-21 at 8 35 48 PM


  1. When an Object is initialized with an empty object and then if it is only manipulated ( one at a time ) then it works perfectly fine
Screen Shot 2020-12-21 at 8 36 37 PM

Originally posted by @Pranomvignesh in https://github.com/microsoft/monaco-editor/issues/2278#issuecomment-749024514

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue で説明されている 3 つのオブジェクト宣言シナリオを Monaco Editor playground と VS Code で再現します。オブジェクトキーに対する TypeScript の completion の動作を追跡し、異なる候補が期待されるものかどうかを判断します。完了の条件は、報告されたシナリオでプロパティ補完が一貫していることです。関連するテスト箇所が見つかった場合は、回帰テストのカバレッジも追加します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, typescript
領域
compilers, developer-experience
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。