Skip to content

Navigation Menu

Sign in
Sign up

Add command to pool all open tabs into a multibuffer - #1

Draft
raulk with Copilot wants to merge 3 commits into
main from
copilot/add-multibuffer-command
Draft

Add command to pool all open tabs into a multibuffer #1
raulk with Copilot wants to merge 3 commits into
main from
copilot/add-multibuffer-command

Conversation

Copilot AI commented Oct 11, 2025
edited
Loading

Copy link
Copy Markdown

Summary

Implements a new command PoolOpenTabsIntoMultibuffer that collects all open editor tabs and displays them together in a single multibuffer view.

Problem

Users working with multiple related files often need to view or search across all open tabs simultaneously. Previously, there was no built-in way to consolidate all open tabs into a single view.

Solution

Added a new workspace command that:

  • Iterates through all open editors in the workspace
  • Collects the singleton buffers (individual file buffers) from each editor
  • Creates a new multibuffer containing the full content of all open files
  • Opens the multibuffer in a new editor tab titled "All Open Tabs"

Usage

Users can invoke this command from the Command Palette (Cmd/Ctrl+Shift+P):

  1. Open the Command Palette
  2. Search for "Pool Open Tabs Into Multibuffer"
  3. Execute the command

A new editor tab will appear showing all open files' contents with headers indicating each filename.

Implementation Details

The implementation follows the same pattern as the existing OpenSelectionsInMultibuffer command and reuses the open_locations_in_multibuffer infrastructure that's already used by search results and other features.

Changes:

  • Added action definition in crates/editor/src/actions.rs
  • Implemented handler method in crates/editor/src/editor.rs
  • Registered action with workspace initialization

The implementation is minimal (34 lines), non-breaking, and follows existing code patterns in the editor.

Closes #<issue_number>

Original prompt

Create a command that pools all open tabs into a new multibuffer


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title (削除) [WIP] Add command to pool all open tabs into a new multibuffer (削除ここまで) (追記) Add command to pool all open tabs into a multibuffer (追記ここまで) Oct 11, 2025
Copilot AI requested a review from raulk October 11, 2025 11:51

raulk commented Oct 11, 2025

Copy link
Copy Markdown
Owner

@copilot can you check if this could be built as an extension instead?

Copilot AI commented Oct 11, 2025

Copy link
Copy Markdown
Author

@copilot can you check if this could be built as an extension instead?

Unfortunately, this cannot be built as an extension with the current extension API. Extensions in Zed are limited to:

  • Language servers
  • Debuggers
  • Themes/icon themes
  • Slash commands (for assistant)
  • MCP servers

The extension API (defined in WIT interfaces) does not currently expose:

  • Workspace-level action registration
  • Access to open editors or buffers
  • Multibuffer creation/manipulation
  • Workspace item enumeration

This feature requires direct access to the editor and workspace APIs, which are only available to core Zed code. The implementation had to be placed in crates/editor/src/editor.rs where it has access to:

  • workspace.items_of_type::<Editor>(cx) to enumerate editors
  • editor.buffer().as_singleton() to access buffers
  • Editor::open_locations_in_multibuffer() to create the multibuffer

If you'd like to make features like this extensible in the future, the extension API would need to be enhanced to support workspace commands and provide access to workspace items.

Copilot AI and others added 3 commits October 29, 2025 18:40
Co-authored-by: raulk <1101242+raulk@users.noreply.github.com>
Co-authored-by: raulk <1101242+raulk@users.noreply.github.com>
raulk force-pushed the copilot/add-multibuffer-command branch from 6ba81d3 to 51839ab Compare October 29, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@raulk raulk Awaiting requested review from raulk

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /