Add full type hover popup to VS Code commands
See original GitHub issueSeveral issues have been opened for this problem, but they have been closed as a duplicate of an issue which barely mentions the problem, let alone addresses it: https://github.com/microsoft/vscode/issues/64566
The closed issues are:
- https://github.com/microsoft/vscode/issues/66405
- https://github.com/microsoft/vscode/issues/76480
- https://github.com/microsoft/vscode/issues/66405
The problem is simple. The three dots means you can’t copy and paste definitions like you used to be able to. This is an absolutely essential feature because TypeScript isn’t even close to being used everywhere, and the intellisense of Javascript files inside TypeScript files is way worse than inside Javascript files. This basically means the easiest way to create a d.ts file is to copy the type definition in the hover inside Javascript and then paste it into a d.ts file so TypeScript files can use it. It also helps me debug overloads and unions when things are going awry.
Even just a command that would popup the hover with the full definition instead of the abbreviated definition would be incredibly useful. Currently the shortcut is Ctrl+k, Ctrl+i
for the abbreviated definition, so I take it there is a command behind it that can be typed into the command list (ctrl+shift+p
). So even just adding the command for people to manually add a shortcut for would be really useful.
I can work around it, but I spend hours more time per week because of it.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:33
- Comments:19 (4 by maintainers)
“noErrorTruncation”: true Did not work correctly for me even though it’s been proposed several times as a solution in other questions like this one.
A quick fix that actually does work would be… some kind of a more offensive solution ;p Start by opening <Microsoft VS Code install folder>/resources/app/extensions/node_modules/typescript/lib/tsserver.js and change ts.defaultMaximumTruncationLength = 160 at around line 13471 (so far) to something higher like ts.defaultMaximumTruncationLength = 800.
This will get you what you are waiting for. A nice 800 chars long max type definition on hover. You can of course custom this value as much as you want.
This might not be politically correct for you will need to do it again after every vs code update, but it works just fine and you’ll finally get your full type on hover. Note that you’ll need to restart your tsServer. To do so:
in vscode: ctrl + shift + P -> type “restart ts server” -> press enter. wait a couple seconds, it’s fairly quick.
The name field is obvious and useless and I would just remove the contents or change them to a named reference, but the generic inside options: TouchableFeedbackOptions gives me no information, and I critically need to know what the exact properties are being brought in.