Repository: CodeEditApp/CodeEdit
File: CodeEdit/Features/Documents/Controllers/CodeEditWindowController.swift (Swift)

Code before:
            name: "Quick Open",
            title: "Quick Open",
            id: "quick_open",
            command: CommandClosureWrapper(closure: { self.openQuickly(self) })
        )

        CommandManager.shared.addCommand(
            name: "Toggle Left Sidebar",
            title: "Toggle Left Sidebar",
            id: "toggle_left_sidebar",
            command: CommandClosureWrapper(closure: { self.toggleFirstPanel() })
        )

        CommandManager.shared.addCommand(
            name: "Toggle Right Sidebar",
            title: "Toggle Right Sidebar",
            id: "toggle_right_sidebar",
            command: CommandClosureWrapper(closure: { self.toggleLastPanel() })
        )
    }

    private func setupSplitView(with workspace: WorkspaceDocument) {
        let feedbackPerformer = NSHapticFeedbackManager.defaultPerformer
        let splitVC = CodeEditSplitViewController(workspace: workspace, feedbackPerformer: feedbackPerformer)

        let navigatorViewModel = NavigatorSidebarViewModel()
        navigatorSidebarViewModel = navigatorViewModel

        let settingsView = SettingsInjector {
            NavigatorSidebarView(workspace: workspace, viewModel: navigatorViewModel)
                .environmentObject(workspace)
                .environmentObject(workspace.tabManager)
        }

        let navigator = NSSplitViewItem(
            sidebarWithViewController: NSHostingController(rootView: settingsView)
        )
        navigator.titlebarSeparatorStyle = .none
        navigator.minimumThickness = Self.minSidebarWidth
        navigator.collapseBehavior = .useConstraints

        splitVC.addSplitViewItem(navigator)

        let workspaceView = SettingsInjector {
            WindowObserver(window: window!) {
                WorkspaceView()
                    .environmentObject(workspace)
                    .environmentObject(workspace.tabManager)
                    .environmentObject(workspace.debugAreaModel)
            }
        }

Review comment (suggestion):
Here a `NavigatorSidebarViewModel` is also created, but just to pass it onto the `NavigatorSidebarView`. It's not used in other places in this class

Code after:
            name: "Quick Open",
            title: "Quick Open",
            id: "quick_open",
            command: CommandClosureWrapper(closure: { self.openQuickly(self) })
        )

        CommandManager.shared.addCommand(
            name: "Toggle Navigator",
            title: "Toggle Navigator",
            id: "toggle_left_sidebar",
            command: CommandClosureWrapper(closure: { self.toggleFirstPanel() })
        )

        CommandManager.shared.addCommand(
            name: "Toggle Inspector",
            title: "Toggle Inspector",
            id: "toggle_right_sidebar",
            command: CommandClosureWrapper(closure: { self.toggleLastPanel() })
        )
    }

    private func setupSplitView(with workspace: WorkspaceDocument) {
        let feedbackPerformer = NSHapticFeedbackManager.defaultPerformer
        let splitVC = CodeEditSplitViewController(workspace: workspace, feedbackPerformer: feedbackPerformer)

        let navigatorViewModel = NavigatorSidebarViewModel()
        navigatorSidebarViewModel = navigatorViewModel

        let settingsView = SettingsInjector {
            NavigatorAreaView(workspace: workspace, viewModel: navigatorViewModel)
                .environmentObject(workspace)
                .environmentObject(workspace.editorManager)
        }

        let navigator = NSSplitViewItem(
            sidebarWithViewController: NSHostingController(rootView: settingsView)
        )
        navigator.titlebarSeparatorStyle = .none
        navigator.minimumThickness = Self.minSidebarWidth
        navigator.collapseBehavior = .useConstraints

        splitVC.addSplitViewItem(navigator)

        let workspaceView = SettingsInjector {
            WindowObserver(window: window!) {
                WorkspaceView()
                    .environmentObject(workspace)
                    .environmentObject(workspace.editorManager)
                    .environmentObject(workspace.utilityAreaModel)
            }
        }