microsoft / vscode

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

`SettingsEditor2` shows progress each time I open a file #226728

Open bpasero opened 2 weeks ago

bpasero commented 2 weeks ago

Steps to Reproduce:

  1. switch between a file and settings.json
  2. notice how a progress bar shows up each time

Stack points to:

withProgress (progressService.ts:51)
M (dirtydiffDecorator.ts:1334)
(anonymous) (dirtydiffDecorator.ts:1307)
queue (async.ts:231)
(anonymous) (async.ts:423)
(anonymous) (async.ts:364)
Promise.then (async)
trigger (async.ts:358)
trigger (async.ts:423)
J (dirtydiffDecorator.ts:1307)
I (dirtydiffDecorator.ts:1298)
Ee (dirtydiffDecorator.ts:1253)
o (instantiationService.ts:162)
createInstance (instantiationService.ts:128)
F (dirtydiffDecorator.ts:1646)
(anonymous) (dirtydiffDecorator.ts:1612)
(anonymous) (event.ts:187)
B (event.ts:1242)
C (event.ts:1253)
fire (event.ts:1277)
(anonymous) (editorService.ts:173)
B (event.ts:1242)
C (event.ts:1253)
fire (event.ts:1277)
(anonymous) (editorGroupView.ts:1286)
await in (anonymous) (async)
Kb (editorGroupView.ts:1301)
Jb (editorGroupView.ts:1259)
openEditor (editorGroupView.ts:1163)
openEditor (editorService.ts:573)
await in openEditor (async)
ub (anythingQuickAccess.ts:1083)
accept (anythingQuickAccess.ts:1040)
(anonymous) (pickerQuickAccess.ts:343)
B (event.ts:1242)
C (event.ts:1253)
fire (event.ts:1277)
Ub (quickInput.ts:943)
(anonymous) (quickInput.ts:991)

Image

lszomoru commented 2 weeks ago

@alexr00, could you please an initial look? Thank you!

lszomoru commented 2 weeks ago

looked quickly at the code and its not clear to me why progress is being shown in the editor when the progress location is Scm 🤔 https://github.com/microsoft/vscode/blob/7473068e0d7b62bfd4ef4c8f6b86832448ff1d36/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts#L1334

bpasero commented 2 weeks ago

Maybe also fyi @benibenj

alexr00 commented 2 weeks ago

Weirdly, I can repro with insiders, but not out of source.

lszomoru commented 2 weeks ago

@alexr00, some extension maybe?

alexr00 commented 2 weeks ago

Now I can't repro it even in insiders. @bpasero is it possible the stack you pulled is unrelated and that there was something else adding progress to the editor?

bpasero commented 2 weeks ago

Looks like the diff decorator is not causing this, its the settings editor. @rzhao271 it seems to listen to this event and doing work even when not the active editor:

https://github.com/microsoft/vscode/blob/96475999252541f346cc68976cc3e15ac6701b7f/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts#L1281

Steps:

=> 🐛 notice how a progress bar appears sometimes after having switched to other editors

If you do not see it, put a breakpoint to the event onConfigUpdate that is handled even when the settings editor is hidden.

I suggest to suspend any listening activity when the editor is hidden.

lszomoru commented 2 weeks ago

@bpasero, thank you very much for looking into this further!