microsoft / microsoft/TypeScript
Annotations/IntelliSense gets lost with simple `&` and `|` joins or utilities
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔎 Search Terms
IntelliSense, comments, annotations, symbol annotation, utilities, utility, union, intersection
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about annotations
⏯ Playground Link
💻 Code
// follow Playground link to see behavior
export interface Foo {
/** An annotation for first property */
firstProperty: boolean
/** An annotation for second property */
secondProperty: number
}
export interface Bar {
/** An annotation for the third property */
thirdProperty: string
}
const foo: Foo = {
// roll over to get annotation
firstProperty: false,
// roll over to get annotation
secondProperty: 42
}
export type FooAndOrBar = (Foo & Bar) | Foo | Bar
const fooAndBar: FooAndOrBar = {
// rollover annotations don't work here
firstProperty: true,
secondProperty: 2,
thirdProperty: "hello"
}
🙁 Actual behavior
IntelliSense doesn't work on properties after running through & (intersections) with | (unions) or more complex type manipulation.
🙂 Expected behavior
I expected the annotation to "come along" with the symbol and appear in IntelliSense.
Additional information about the issue
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la riproduzione collegata di TypeScript Playground e confronta l’IntelliSense delle proprietà per Foo, Bar e FooAndOrBar. Traccia come vengono preservate le annotazioni attraverso i tipi di intersezione e unione, quindi verifica che l’IntelliSense di rollover mostri le annotazioni previste per tutte e tre le proprietà.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers, developer-experience
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100