microsoft / vscode

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

Outline trying to reveal activeEntry when entry is filtered out #208923

Closed roblourens closed 5 months ago

roblourens commented 5 months ago

I saw this once a couple days ago, and again today

image
2024-03-27 11:03:48.642 [error] TreeError [OutlinePane] Tree element not found: [object Object]: Error: TreeError [OutlinePane] Tree element not found: [object Object]
    at T.o (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:29689)
    at T.getListIndex (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:28692)
    at Y.getRelativeTop (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:626:2556)
    at V (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38288)
    at P.jc (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38425)
2024-03-27 11:06:20.347 [error] [Extension Host] [extension] Error: Response stream has been closed
    at Object.markdown (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:855:1469)
    at p (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:895:7332)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at hE.processResponse (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:897:27)
    at oE.fetchConversationResponse (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:859:1735)
    at oE._provideResponseWithProgress (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:857:1618)
    at oE.provideResponseWithProgress (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:855:1830)
    at r.x (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:869:859)
2024-03-27 11:06:29.734 [error] [Extension Host] [extension] Error: Response stream has been closed
    at Object.markdown (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:855:1469)
    at p (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:895:7332)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at hE.processResponse (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:897:27)
    at oE.fetchConversationResponse (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:859:1735)
    at oE._provideResponseWithProgress (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:857:1618)
    at oE.provideResponseWithProgress (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:855:1830)
    at r.x (/Users/roblou/.vscode-insiders/extensions/github.copilot-chat-0.14.2024032701/dist/extension.js:869:859)
2024-03-27 11:11:15.667 [error] TreeError [OutlinePane] Tree element not found: [object Object]: Error: TreeError [OutlinePane] Tree element not found: [object Object]
    at T.o (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:29689)
    at T.getListIndex (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:28692)
    at Y.getRelativeTop (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:626:2556)
    at V (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38288)
    at P.jc (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38425)
2024-03-27 11:18:53.876 [error] TreeError [OutlinePane] Tree element not found: [object Object]: Error: TreeError [OutlinePane] Tree element not found: [object Object]
    at T.o (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:29689)
    at T.getListIndex (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:28692)
    at Y.getRelativeTop (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:626:2556)
    at V (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38288)
    at P.jc (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38425)
2024-03-27 11:33:54.451 [error] TreeError [OutlinePane] Tree element not found: [object Object]: Error: TreeError [OutlinePane] Tree element not found: [object Object]
    at T.o (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:29689)
    at T.getListIndex (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:28692)
    at Y.getRelativeTop (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:626:2556)
    at V (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38288)
    at P.jc (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38425)
2024-03-27 11:33:59.429 [error] TreeError [OutlinePane] Tree element not found: [object Object]: Error: TreeError [OutlinePane] Tree element not found: [object Object]
    at T.o (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:29689)
    at T.getListIndex (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:192:28692)
    at Y.getRelativeTop (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:626:2556)
    at V (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38288)
    at P.jc (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38425)
Yoyokrazy commented 5 months ago

update after trying to repro:

Yoyokrazy commented 5 months ago
Yoyokrazy commented 5 months ago

Still no consistent repro or solution after a debug session with peng, will need to put a bigger effort into this in the future, and look out for a consistent repro.

cc @joaomoreno Wondering if there's a way that we can make sure that the treeview can recover from this? Bit painful forcing a full reload. The treeview fails on a setSelection call and from that point the DOM node is fully present regardless of editor switching.

deepak1556 commented 5 months ago

@joaomoreno is OOF till next week, if this requires attention from him I suggest we move the issue to next milestone or the recovery milestone. I don't see any candidate label, please let me know otherwise.

shubhamv199 commented 5 months ago

the issue is still happening. Sometimes the outline is stuck and its view remains the same even if I open a new notebook with different content.

jorenham commented 5 months ago

I can confirm this (latest PopOS; Ubuntu 22.04, Linux 6.8.0 and code 1.88.0).

Once I open a notebook, the outline stops updating, and requires a full vscode restart. On opening a notebook, I see the following Window output:

2024-04-08 16:11:01.120 [error] TreeError [OutlinePane] Tree element not found: [object Object]: Error: TreeError [OutlinePane] Tree element not found: [object Object]
    at T.o (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:192:29689)
    at T.getListIndex (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:192:28692)
    at Y.getRelativeTop (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:626:2556)
    at V (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38326)
    at P.jc (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:2334:38463)
jrieken commented 5 months ago

@Yoyokrazy should we track this as candidate? (assuming fix is in reason)

Yoyokrazy commented 5 months ago

@jrieken Yep, I think that's pretty fair. Given the only way out of the broken state is a full reload, it seems breaking enough (and a regression) to warrant candidate status.

Yoyokrazy commented 5 months ago

Easy repro:

Yoyokrazy commented 5 months ago

Description of issue (from PR) When outline view was set to follow cursor, the treeview will try to highlight the active entry in the outline view. After the latest iteration, users are now able to exclude a variety of cell types from the view. This filtering logic was shifted to the treeview's getChildren call in order to preserve the outline model for other computations (namely nb sticky scroll).

Easiest example is if the user excludes code cells (the default behavior), and then clicks a code cell. The treeview will attempt to highlight the entry, but as the cell was filtered out, there would be an error as the entry cannot be found. This breaks the outline view entirely, and the treeview cannot recover. Ideally this wouldn't force a reload, but this PR ensures that a notebook entry exclusion error will not break the view state.

rzhao271 commented 5 months ago

I confirmed that nothing shows up in the outline and no errors are thrown in the devtools console.