microsoft / microsoft/TypeScript

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

Aperta
#42,071 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo i tre scenari di dichiarazione di oggetti descritti nell’issue nel Monaco Editor playground e in VS Code. Traccia il comportamento di completion di TypeScript per le chiavi degli oggetti e determina se i suggerimenti differenti sono previsti; il lavoro è completo quando gli scenari segnalati hanno completamenti delle proprietà coerenti, con copertura di regressione se viene individuata la posizione di test pertinente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, typescript
Ambito
compilers, developer-experience
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.