Repository navigation
Description
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: microsoft/vscode#64566
The closed issues are:
- Show Hover: Disable three dots abbreviation (Ctrl+K Ctrl+I) vscode#66405
- Show full type in typescript type hover hint vscode#76480
- Show Hover: Disable three dots abbreviation (Ctrl+K Ctrl+I) vscode#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.
Activity
mjbvz commentedon Dec 6, 2019
Arlen Beiler (@Arlen22) This is what microsoft/vscode#64566 is about: being able to expand the error to see more detail.Even in JS there are types that are too large to display (or infinite), so it is not possible to just always expand the
...eagerly.Can you provide sample code that shows when the
...gets in the wayArlen22 commentedon Dec 7, 2019
An infinite recursion should simply be marked as
infinite(same color asnever) indicating that some level of recursion is involved, I suppose, and the user could then end the recursive reference in some way in order to get a complete type output.Normally the types I work with are not too large to display. If they are I can usually break them apart into smaller chunks in one way or another, either by making minor edits to the Javascript or by handwriting a Record, or stuff like that.
It's just that the
...prevents this from working at all, especially since I don't really know whether all...are referring to the exact same type or what that type is. And then someone mentioned| ... and 4 more ... |in a string union, which obviously completely breaks copy and paste.mjbvz commentedon Dec 7, 2019
Can you provide some specific code examples?
Arlen22 commentedon Dec 9, 2019
Arlen22 commentedon Dec 9, 2019
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.
mjbvz commentedon Dec 10, 2019
Moving upstream to get more feedback from the TS Team
Ciantic commentedon Dec 23, 2019
This is same request I had in the diagnostics issue.
Use case I had is that I often found myself seeing a type in the hover tip, and copying it out. It never worked after the changes.
I actually don't understand why the hover tip needs to be abbreviated with three dots. It has a scrollbar. It's perfect abbreviation itself, you can expand it by scrolling! Even if the three dots were expandable by clicking, it would be worse UI in terms of usability, scrolling is easier way to "expand" the view.
P.S. Recursive types are an outlier, I don't mind having dots for them (since it can be infinite). I think in general VSCode should try to show as much as possible of the type, and user can scroll if they wish to see more of the type.
Arlen22 commentedon Dec 23, 2019
Can we somehow make this a VS Code setting? I guess this is in Typescript now, so whatever the equivalent would be here.
Arlen22 commentedon Dec 25, 2019
And now this evening I am diagnosing type problems and it is not showing me a second type that I know is different than the first one that it is showing me. It’s a union on the values of an object and it is only expanding the first type in the union.
DanielRosenwasser commentedon Dec 30, 2019
Just as a heads up, there's a
noErrorTruncationoption which you can set totrue, which I believe gives you the behavior you're looking for.20 remaining items
shwarcu commentedon Feb 5, 2024
This is extremely annoying when working with long types that are calculated and cannot be checked in source

nikelborm commentedon Feb 5, 2024
For those who haven't seen this plugin:
https://marketplace.visualstudio.com/items?itemName=mxsdev.typescript-explorer
wysez commentedon Feb 21, 2024
heysokam commentedon May 1, 2024
Thank you for sharing. Nextlevel useful ✍️
vennson commentedon Jul 1, 2024
Long term solution by @extremegf
in vscode
node_modules/typescript/lib/tsserver.jsornode_modules/typescript/lib/typescript.jsvar defaultMaximumTruncationLength = 1601000or value of your choosing.PS.
noErrorTruncationin tsconfig didn't work for me.Before:

with ...
After:

You can also drag the bottom border
kimhwanhoon commentedon Jul 22, 2024
I'm useing typescript v5, I found that on
tsc.jsnottsserver.js.wertania commentedon Aug 4, 2024
+1
f15u commentedon Sep 10, 2024
EDIT: I fixed it patching
typescript.jsinstead (this is for v5.6.2):Old post:
It used to work in TS 5.4, but now it doesn't (I tried every minor version back to 5.0.4). Even in 5.6, with the following patch, complex types are truncated:
Results in:
I suspect this is related to VS Code updates, even though I'm using the TypeScript workspace version.
SinghChinmay commentedon Sep 24, 2024
Thanks, I was halfway making my extension for vs code, you saved me a lot of time.
extremegf commentedon Sep 25, 2024
I would still happily use your extension :)
pauldvu commentedon Nov 15, 2024
Back to update my workaround :
If you have bun as your package manager you can use the
bun patchcommand in order toensure that your modifications are re-applied after each
bun installStep 1: Run Bun Patch
Step 2: Edit The Package
./patches/typescript@5.8.0-dev.20241113.patch
Step 3: Commit The Patch
bun patch --commit 'node_modules/typescript'Troubleshooting
Prees Command Shift P
Search " Typescript Select "
*If you don't see this option open a typescript file to active typescript in vscode
Lastly restart the language server
mb21 commentedon Sep 22, 2025
Anybody else where changing
js/ts.hover.maximumLengthin vscode doesn't do anything, or at least not for this case?p-bakker commentedon Nov 3, 2025
Same here, but is due to Astro extension for me, see microsoft/vscode#259321