问题
Context
I'm using VS Code in a fairly large repo and my extension host keeps crashing. When I run the editor with extensions disabled I'm able to work without interruption. During these times VS Code is using the vast majority of my machines CPU.
Question
Is there a way for me to inspect which extension is the culprit causing the crashes?
回答1:
There is a new feature coming in v1.52 - Extension Bisect
- which could help with determining which extension is causing an issue. See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_52.md#trouble-shooting-extension-bisect
... sometimes extensions misbehave and sometimes it isn't obvious if an issue is caused by an extension and if so by which extension. Until today, you needed to disable all extensions and then one by one re-enable extensions to find a bad extension. This process is now getting easy with a new feature called "Extension Bisect". It uses the binary search algorithm to quickly identify an extension that causes trouble. In essence, it disables half your extensions and asks you to check for the issue you were seeing. If the issue is gone the bad extension must have been in the list of disabled extensions, otherwise in the list of enabled extensions. This process is now repeated on the list, which must contain the bad extension until only a single extension is left.
You can start extension bisect via Start Extension Bisect. It then guide through the process of repeatedly disabling and re-enabling extensions. After each reload you will be prompted to confirm if the issue is still there.
"Extension Bisect" will repeatedly ask you to check if the issue is still there or not. You can always abort via Stop Bisect and when having dismissed the bisect notification you can continue via Continue Extension Bisect.
see images at the release note link.
回答2:
When the extension host crashes, you should get a popup window that asks to debug the process or restart the extension host. If you debug the process, you will see a number of errors. Reviewing each error will identify the bad extension.
来源:https://stackoverflow.com/questions/59277252/how-do-i-determine-which-vs-code-extension-is-causing-a-crash