pretty-ts-errors icon indicating copy to clipboard operation
pretty-ts-errors copied to clipboard

Saving a file is hanging indefinitely

Open lildesert opened this issue 1 year ago • 6 comments
trafficstars

Describe the bug Hi, since today this extension has been causing the save file action to hang indefinitely. I deactivated all my VSCode extensions and this one seems to cause the issue. I don't have any more insight but I'll be happy to send more if someone provides guidance.

I use the v0.5.2 and also tried the v0.5.1 which causes the same issue.

Here's my VSCode info:

Version: 1.84.2 Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e Date: 2023-11-09T10:52:57.054Z (1 wk ago) Electron: 25.9.2 ElectronBuildId: 24603566 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Darwin arm64 21.5.0

Expected behavior Saving a file should be instant.

Screenshots image

lildesert avatar Nov 22 '23 09:11 lildesert

Having the same issue. Used the VS Code extension bisect tool and in fact it seems to be this extension.

Screenshot 2023-12-10 at 11 29 29

To me it seems to happen when working with code where the TS errors are super long. I've solved it for now with setting "noErrorTruncation": false,. It's not ideal but it seems to work.

summaarum avatar Dec 10 '23 09:12 summaarum

It is weird because the extension does not interfere saving of files, Does someone see some behavior that could cause that? maybe something that we're not doing correctly in the extension?

I also failed to reproduce it, so it would be great if someone could help with that.

yoavbls avatar Mar 01 '24 08:03 yoavbls

I attempted to reproduce by checking out the typescript and vuejs/core repositories. As both are pretty large and vuejs/core is a monorepo. I cannot reproduce any problems with the extensions. Running the extension host profile does not show any performance issues with the extension.

So far it seems this issue and #102 seem to use a macbook, I use a windows machine. Doubt its related but if more people raise issues it could be worth asking.

To me it seems to happen when working with code where the TS errors are super long. I've solved it for now with setting "noErrorTruncation": false,. It's not ideal but it seems to work.

This seems interesting to me. Maybe it has to do with truncated errors? Something like a recursion with regular expressions? It all seems to be handled here: https://github.com/yoavbls/pretty-ts-errors/blob/2531440478077fd3f3335e3e3d1b92c9679eb1bc/src/format/formatTypeBlock.ts#L54-L76

I don't see any reason for the extension to stall in a seemingly infinite loop.

kevinramharak avatar Apr 11 '24 10:04 kevinramharak

Just an FYI, I run Windows, Linux, and macOS and it happens on all three for me, so it doesn't seem to be platform specific. I see this issue most often when moving a typescript file which triggers vscode to update the import paths in any file referencing the moved file.

ChristopherHaws avatar Apr 27 '24 19:04 ChristopherHaws

@ChristopherHaws Thanks for the addition, that is helpful. I'm gonna see if I can reproduce it by moving a file causing TS to update the imports.

kevinramharak avatar May 07 '24 07:05 kevinramharak