语境
我在一个相当大的 repo 中使用 VS Code,我的扩展主机不断崩溃。当我在禁用扩展的情况下运行编辑器时,我可以不间断地工作。在这段时间里,VS Code 使用了我机器的大部分 CPU。
问题
有没有办法让我检查哪个扩展是导致崩溃的罪魁祸首?
最佳答案
v1.52 中有一个新功能 - Extension Bisect
- 这有助于确定导致问题的扩展。见 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.
请参阅发行说明链接中的图片。
关于visual-studio-code - 如何确定哪个 VS Code 扩展导致崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59277252/