question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add full type hover popup to VS Code commands

See original GitHub issue

Several 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:

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:open
  • Created 4 years ago
  • Reactions:33
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
LoveriusBcommented, Sep 17, 2021

“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.

8reactions
Arlen22commented, Dec 9, 2019
ceTouchableFeedback<{
    onPress: () => void;
    object_id: number;
    name: "header" | "italic" | "bold" | "underline" | "repeat" | "link" | "search" | "image" 
| "key" | "code" | "map" | "table" | "th" | "circle" | ... 771 more ... | "snowflake-o";
    style: {
        ...;
    };
}>(options: TouchableFeedbackOptions<...>, ...children: any[]): any (+1 overload)

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trigger advanced hover information with keyboard
Open the command palette and type "show hover" to find the command. enter image description here. The default shortcut does not work for...
Read more >
Visual Studio Code Tips and Tricks
Tip: Type ? to view commands suggestions. Quick Open command list. Typing commands such as edt and term followed by a space will...
Read more >
VS Code tips — Hover peeks - YouTube
Today's VS Code tip: hover peeksWhile hovering over a symbol, VS Code shows its documentation and type info. You can also quickly preview ......
Read more >
Viewing type definitions - Visual Studio (Windows)
Ctrl+click is a shortcut for mouse users to quickly access Go To Definition. Symbols become clickable when you press Ctrl and hover over...
Read more >
VS Code: How to Disable/Enable Suggestions on Hover
2. Type “editor.hover.enable” into the search field then check/uncheck the checkbox associated with “Controls whether the hover is shown.” to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found