microsoft / microsoft/TypeScript

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

Offen
#42,071 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Awaiting More Feedback Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die drei im Issue beschriebenen Szenarien für Objekdeklarationen im Monaco Editor playground und in VS Code zu reproduzieren. Verfolge das TypeScript-Completion-Verhalten für Objektschlüssel und ermittle, ob die unterschiedlichen Vorschläge erwartungsgemäß sind; abgeschlossen bedeutet, dass die gemeldeten Szenarien konsistente Property-Vervollständigungen aufweisen, mit Regressionstests, falls die relevante Teststelle gefunden wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
compilers, developer-experience
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.