You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript gives autocomplete suggestions for object properties and literals when a type is known at the time the object is being created / argument typed, i.e. explicitly declared, inferred or cast.
This is how it works:
I've been a long time TypeScript user and have recently started contributing to a large project which is based on Flow and this is the single feature that I miss the most (right next to live-feedback). I have tried multiple Flowtype integrations (Atom/Nuclide, WebStorm, VSCode, SublimeText) and none of them offer this type of autocompletion, so I presume the problem is that the Flow server simply does not offer this information.
These are some of the scenarios that should be supported:
explicitly declared
typeType={a: string}consta: Type={// ... autocomplete all properties in Type}
type known through a nested definition
typeOtherType={a: string}typeType={a: OtherType}consta: Type={a: {// ... autocomplete all properties in OtherType}}
type inferred / expected
typeType={a: string};functionexample(param: Type){};example({/* ... autocomplete all properties in Type */});
type declared indirectly
typeType={a: string}functionexample(): Type{return{// ... autocomplete all properties in Type}}
type cast
typeType={a: string}functionexample(){return({// ... autocomplete all properties in Type} : Type)}
The text was updated successfully, but these errors were encountered:
Can we have a meaningful discussion about this topic? I would like to get this supported for cssinjs in order to autocomplete styles.
niieani
changed the title
Autocomplete suggestions for missing properties when creating new objects of an expected type
Autocomplete suggestions for missing properties when creating new objects/literals of an expected type
May 28, 2017
@calebmer mentioned last year in a tweet that he's going to focus on this and other IDE-related issues this year. Year hasn't ended yet, so I'm hopeful 😂.
TypeScript gives autocomplete suggestions for object properties and literals when a type is known at the time the object is being created / argument typed, i.e. explicitly declared, inferred or cast.
This is how it works:
I've been a long time TypeScript user and have recently started contributing to a large project which is based on Flow and this is the single feature that I miss the most (right next to live-feedback). I have tried multiple Flowtype integrations (Atom/Nuclide, WebStorm, VSCode, SublimeText) and none of them offer this type of autocompletion, so I presume the problem is that the Flow server simply does not offer this information.
These are some of the scenarios that should be supported:
The text was updated successfully, but these errors were encountered: