-
Notifications
You must be signed in to change notification settings - Fork 28.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotkey to get type information for the selected expression #65890
Comments
Alternative: https://marketplace.visualstudio.com/items?itemName=MartinJohns.inline-types TS can implement this using the existing VS Code apis. Not sure if there are enough other use cases that we need a dedicated api |
@alisabzevari You can today already press |
@jrieken One problem with the VS Code hover api and UX is that hover uses a position instead of a selection range. A hover provider could decide to use the current selection if the cursor position is within it but this could result in a confusing UX |
I think this feature does not contradict with hover feature. This is how I image them together:
|
Now this is broken, I can't anymore copy & paste the type definition from the "Ctrl+K Ctrk+i", I get these darn abbreviations with three dots:
This thee dots abbreviation is some new addition, can we disable that? I constantly copy & paste the type definitions, ctrl+k ctrl+i is now useless for me. EDIT I'm creating a bug report, this is bad: #66405 |
Closing this since it has not gotten a significant number of 👍 over the past two years |
This is a pretty significant missing feature in VS Code that I've been missin ever since I started using it. Type annotations are being used more and more frequently even by languages of dynamic nature like Python, TypeScript, etc. Coming from a Scala background, I've been using this feature of IntelliJ idea to get the inferred type of a selected expression. It is quite inconvenient to assign a selection to a variable each time just to see its type, not just coding yourself but especially if you are reviewing a code or reading a library source or a previous work. I'd suggest reopening this issue as it is clearly not out of scope of VS Code since the type hint is already a feature of it. |
Please reopen this!!! |
I worked around this by remapping |
Intellij has a very useful feature called "show type info" that shows type information for the selected expression. For example, consider the following code:
In Intellij IDEA it is possible to select
str + count
expression and pressalt + =
and get the result type of the selected expression (string
in the example).I think this feature would be very beneficial specially in the languages that type inference is very important. Although I am not sure this repository is the right place to ask for this feature.
The text was updated successfully, but these errors were encountered: