Microsoft/TypeScript
Ver no GitHubAnnotations/IntelliSense gets lost with simple `&` and `|` joins or utilities
Open
#57.418 aberto em 15 de fev. de 2024
Experience EnhancementHelp WantedSuggestion
Métricas do repositório
- Stars
- (48.455 stars)
- Métricas de merge de PR
- (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)
Description
🔎 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