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
being typed with | string to enable to pass any arbitrary value as a type hint. However, this results in an incorrect autocomplete by the TS LSP as shown in the image below:
My proposal would be to instead type the union like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I see the intention of the interface
being typed with
| string
to enable to pass any arbitrary value as a type hint. However, this results in an incorrect autocomplete by the TS LSP as shown in the image below:My proposal would be to instead type the union like this:
This tricks the language server to make a proper type inference and actually provide useful code completion without actually breaking anything:
Beta Was this translation helpful? Give feedback.
All reactions