Closed ctf0 closed 4 years ago
I can reproduce. Exact steps:
[1]
)[2]
shows up)=> 🐛 at this point the grid is broken. reloading the window does not restore the grid anymore failing with [3]
I cannot reproduce in Stable.
[1]
ERR Cannot read property 'length' of undefined: TypeError: Cannot read property 'length' of undefined
at GridView.trySet2x2 (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/grid/gridview.js:807:36)
at SerializableGrid.layout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/grid/grid.js:437:31)
at GridWidgetView.layout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/parts/editor/editorPart.js:43:33)
at CenteredViewLayout.layout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/centered/centeredViewLayout.js:63:27)
at EditorPart.doLayout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/parts/editor/editorPart.js:725:39)
at EditorPart.layout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/parts/editor/editorPart.js:720:18)
at LeafNode.layout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/grid/gridview.js:448:23)
at VerticalViewItem.layout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/splitview/splitview.js:75:23)
at SplitView.layoutViews (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/splitview/splitview.js:627:26)
at SplitView.relayout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/splitview/splitview.js:534:18)
at SplitView.onViewChange (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/splitview/splitview.js:403:22)
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/splitview/splitview.js:461:70
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/event.js:70:138
at Emitter.fire (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/event.js:458:38)
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/event.js:43:93
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/event.js:70:138
at Emitter.fire (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/event.js:458:38)
at EditorPart.doSetGridWidget (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/parts/editor/editorPart.js:704:37)
at EditorPart.doCreateGridControlWithState (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/parts/editor/editorPart.js:695:18)
at EditorPart.applyLayout (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/parts/editor/editorPart.js:303:18)
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/parts/editor/editorCommands.js:184:32
at InstantiationService.invokeFunction (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/platform/instantiation/common/instantiationService.js:43:27)
at CommandService._tryExecuteCommand (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/services/commands/common/commandService.js:73:74)
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/services/commands/common/commandService.js:63:47
at async Object.triggerAndDisposeAction (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/common/actions.js:83:17)
at async file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/common/actions.js:62:21
[2]
Error: Invalid tail call
at Object.tail2 (arrays.js:19)
at GridView.addView (gridview.js:556)
at SerializableGrid._addView (grid.js:219)
at SerializableGrid.addView (grid.js:199)
at EditorPart.doAddGroup (editorPart.js:353)
at EditorPart.addGroup (editorPart.js:344)
at moveActiveEditorToGroup (editorCommands.js:142)
at moveActiveEditor (editorCommands.js:91)
at handler (editorCommands.js:51)
at idOrCommand.handler (commands.js:34)
at InstantiationService.invokeFunction (instantiationService.js:43)
at CommandService._tryExecuteCommand (commandService.js:73)
at commandService.js:63
at async Object.triggerAndDisposeAction (actions.js:83)
[3]
ERR this.root.style is not a function: TypeError: this.root.style is not a function
at GridView.style (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/grid/gridview.js:539:23)
at SerializableGrid.style (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/browser/ui/grid/grid.js:166:27)
at EditorPart.updateStyles (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/parts/editor/editorPart.js:586:29)
at EditorPart.create (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/part.js:44:18)
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/workbench.js:225:34
at Array.forEach (<anonymous>)
at Workbench.renderWorkbench (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/workbench.js:223:15)
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/workbench.js:75:26
at InstantiationService.invokeFunction (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/platform/instantiation/common/instantiationService.js:43:27)
at Workbench.startup (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/browser/workbench.js:62:38)
at DesktopMain.open (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/electron-browser/desktop.main.js:61:52)
My investigation shows that this was introduced when fixing https://github.com/microsoft/vscode/issues/84425 with commit https://github.com/microsoft/vscode/commit/1bd3750d655b6f2da429307419092af01a311653.
This change unintentionally broke an assumption that has always been made with the grid view: The root node will always be a branch node. I first tried updating grid view to allow for this behavior but the changes were more dangerous as that assumption permeates the many classes of gridview.
Thus, the above commit simply allows the rootNode to be single node group. I've also added an exception to be thrown in case someone is already in this bad state so that the editor part will be forced to create a new grid.
@joaomoreno please check my work
Thanks 🍺
@sbatten Great fix! :clap: Those "edge" cases. :laughing:
Env
Steps to Reproduce:
1- create an untitled view or open a file 2- using the below commands in order
workbench.action.moveEditorToxxxGroup
>workbench.action.editorLayoutSingle
>workbench.action.moveEditorToxxxGroup
willinvalid tail call
Does this issue occur when all extensions are disabled?: Yes