microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.82k stars 29.12k forks source link

debugger statement hit when computing large diff #221825

Closed Tyriar closed 1 month ago

Tyriar commented 3 months ago

image

Was computing a diff on this line:

https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/terminalContrib/suggest/test/browser/recordings/windows11_pwsh_namespace_completion.ts#L30

image

After resuming it seems like it silently fails

hediet commented 3 months ago

That usually happens when you step into the diff algortihm and the computation times out because of that. The debugger statement gives you the option to call this.disable() (as stated in the ts source) to continue debugging and disabling the timeout. Maybe the debugger statement shouldn't be active when not running from sources.

Tyriar commented 3 months ago

We shouldn't have any debugger statements in source imo, someone agrees with me considering we have the lint rule:

https://github.com/microsoft/vscode/blob/b4eb7c94495e25b5dc968a4d3a723346e27f48a3/src/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts#L199-L200

Since this can happen in production we should handle it and tell the user something happened.