zed/crates
Cole Miller 8bf3b4fece
git: Refactor buffer_diff point translation APIs for more efficient side-by-side diff syncing (#48237)
The side-by-side diff heavily relies on a primitive from `buffer_diff`
that converts a point on one side of the diff to a range of points on
the other side. The way this primitive is set up on main is pretty
naive--every time we call `points_to_base_text_points` (or
`base_text_points_to_points`), we need to iterate over all hunks in the
diff. That's particularly bad for the case of constructing a new
side-by-side diff starting from a multibuffer, because we call those
APIs once per excerpt, and the number of excerpts is ~equal to the
number of hunks.

This PR changes the point translation APIs exposed by `buffer_diff` to
make it easier to use them efficiently in `editor`. The new shape is a
pair of functions that return a patch that can be used to translate from
the main buffer to the base text or vice versa. When syncing edits
through the block map that touch several excerpts for the same buffer,
we can reuse this patch for excerpts after the first--so when building a
new side-by-side diff, we'll iterate over each hunk just once.

The shape of the new APIs also sets us up to scale down to cases like
editing on the right-hand side of the diff: we can pass in a point range
and give them permission to return an approximate patch that's only
guaranteed to give the correct results when used with points in that
range. For edits that only affect one excerpt, and given how the project
diff is set up, that should allow us to skip iterating over most of the
hunks in a buffer.

Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
2026-02-03 22:18:59 -05:00
..
acp_thread Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
acp_tools ui: Improve performance in the CopyButton component (#47292) 2026-01-21 13:40:42 -03:00
action_log git: Side-by-side diff UI (#47349) 2026-01-22 02:31:14 -05:00
activity_indicator remote: Support opening builtin host files in remote workspaces on wsl (#46910) 2026-01-15 15:21:57 +00:00
agent Add tool security rules that can't be overridden by settings (#48209) 2026-02-02 17:10:31 -05:00
agent_servers Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
agent_settings Disable default tool permissions (#48278) 2026-02-03 20:01:15 +00:00
agent_ui Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
agent_ui_v2 agent_ui: More refactors (#48186) 2026-02-02 13:14:45 +00:00
ai_onboarding Add student plan (#47866) 2026-01-28 21:34:10 +00:00
anthropic ep: Handle errored requests in Anthropic batches (#46351) 2026-01-08 10:59:03 +00:00
askpass Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
assets
assistant_slash_command Handle removed IconName variants in text thread deserialization (#47624) 2026-01-26 23:56:55 +00:00
assistant_slash_commands agent: Multiline review comments (#47448) 2026-01-23 06:25:42 +00:00
assistant_text_thread Fix rate limiter holding permits during tool execution (#47494) 2026-01-23 12:15:55 -05:00
audio gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
auto_update remote: Add configurable remote server cache retention (default 5) (#47202) 2026-01-26 07:25:51 +00:00
auto_update_helper
auto_update_ui remote: Support opening builtin host files in remote workspaces on wsl (#46910) 2026-01-15 15:21:57 +00:00
aws_http_client
bedrock bedrock: Add Bedrock API key authentication support (#41393) 2025-12-17 12:54:57 +01:00
breadcrumbs Multibuffer breadcrumbs toolbar redesign (#45547) 2026-01-06 09:42:00 -03:00
buffer_diff git: Refactor buffer_diff point translation APIs for more efficient side-by-side diff syncing (#48237) 2026-02-03 22:18:59 -05:00
call gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
channel gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
cli cli: Teach --diff to recurse into directories and add a MultiDiffView (#45131) 2026-01-30 10:14:36 +01:00
client client: Fix ACP registry blog post URL (#47881) 2026-01-28 18:28:53 +00:00
clock
cloud_api_client
cloud_api_types Add student plan (#47866) 2026-01-28 21:34:10 +00:00
cloud_llm_client cloud_llm_client: Move Plan type into cloud_api_types (#47778) 2026-01-27 15:58:05 +00:00
codestral nix: Use flake-parts, partitions, and treefmt-nix (#45321) 2026-02-02 14:26:42 +00:00
collab project_panel: Add right-click download option for folders/files stored in remote development server (#47344) 2026-02-03 07:12:29 +00:00
collab_ui git: Fix desynced scrolling between LHS and RHS of side-by-side diff (#47913) 2026-01-31 18:33:22 +00:00
collections
command_palette Revert "Revert scheduler update (#46659)" (#46671) 2026-01-14 07:19:13 +00:00
command_palette_hooks
component
component_preview build: Simplify build graph (#47253) 2026-01-23 18:29:20 +01:00
context_server Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
copilot edit prediction: Drop project state after a project goes away (#48191) 2026-02-02 19:47:44 +01:00
copilot_chat copilot_chat: Fix Anthropic models not appearing in model picker (#47549) 2026-01-25 13:10:22 +01:00
copilot_ui edit prediction: Drop project state after a project goes away (#48191) 2026-02-02 19:47:44 +01:00
crashes Revert "Revert scheduler update (#46659)" (#46671) 2026-01-14 07:19:13 +00:00
credentials_provider gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
dap dap: Make ProtoConversion::to_proto consume self (#47871) 2026-01-28 16:00:52 +00:00
dap_adapters Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
db
debug_adapter_extension Revert "Revert scheduler update (#46659)" (#46671) 2026-01-14 07:19:13 +00:00
debugger_tools gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
debugger_ui git: Fix desynced scrolling between LHS and RHS of side-by-side diff (#47913) 2026-01-31 18:33:22 +00:00
deepseek deepseek: Fix for max output tokens blocking completions (#45236) 2025-12-18 12:47:34 +00:00
denoise
dev_container Simplify error message and provide a route to Zed log (#48301) 2026-02-03 23:07:10 +00:00
diagnostics Implement Vim's tag stack (#46002) 2026-01-15 17:48:15 +00:00
docs_preprocessor Remove zed dependency from docs_preprocessor (#45130) 2025-12-18 21:59:05 -05:00
edit_prediction Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
edit_prediction_cli Add ep truncate-patch command to prepare commits evalset (#48204) 2026-02-02 20:06:15 +02:00
edit_prediction_context Introduce new predict_edits/v3 endpoint (#46960) 2026-01-16 02:16:34 +00:00
edit_prediction_types Fix issues with predicted cursor positions (#48205) 2026-02-02 11:30:43 -07:00
edit_prediction_ui Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
editor git: Refactor buffer_diff point translation APIs for more efficient side-by-side diff syncing (#48237) 2026-02-03 22:18:59 -05:00
encoding_selector encoding: Add "reopen with encoding" (#46553) 2026-01-27 05:27:26 +00:00
eval Fix rate limiter holding permits during tool execution (#47494) 2026-01-23 12:15:55 -05:00
eval_utils Fix self-referential symbolic link (#45265) 2025-12-18 17:26:20 +01:00
explorer_command_injector
extension xtask: Remove transitive GPUI dependency (#47748) 2026-01-27 14:00:45 +01:00
extension_api extension_api: Improve documentation for make_file_executable (#48198) 2026-02-02 20:27:41 +01:00
extension_cli extension: Ensure that compiled extension provides at least one feature (#47715) 2026-01-28 14:25:47 +01:00
extension_host Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
extensions_ui acp: Add agent server extension deprecation banner (#47817) 2026-01-28 10:28:43 +01:00
feature_flags agent: Add thinking toggle for Zed provider (#47407) 2026-01-22 18:08:32 +00:00
feedback
file_finder project: Always allocate WorktreeIDs on the remote client (#47936) 2026-01-29 15:31:13 +00:00
file_icons
fs fs: Cache filesystem case sensitivity (#47995) 2026-01-30 09:42:28 +01:00
fs_benchmarks
fuzzy fuzzy: Use lowercase representations for matrix size calculation (#44338) 2025-12-08 19:50:20 +01:00
git Revert "git: Fix stage/unstage failure with a large number of files (#47800)" (#48238) 2026-02-03 04:24:11 +00:00
git_graph git: Use CDN endpoint for GitHub avatars to avoid rate limiting (#47894) 2026-01-31 13:49:42 -05:00
git_hosting_providers Implement extract_pull_request for GitLab provider (#47973) 2026-01-31 21:56:34 +00:00
git_ui git_ui: Hide "View on GitHub" button when viewing stashes in commit view (#48271) 2026-02-03 17:47:25 +00:00
go_to_line Add optional relative line jumps to go-to-line action (#46932) 2026-01-27 05:51:11 +00:00
google_ai google_ai: Refactor token count methods in Google AI (#45184) 2025-12-17 20:12:40 -06:00
gpui Optimize resource upload in D3D11 (#48282) 2026-02-03 17:15:44 -05:00
gpui_macros gpui: Add min_size and max_size style methods (#47775) 2026-01-27 15:37:22 -03:00
gpui_tokio gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
html_to_markdown
http_client Remove reqwest dependency from gpui (#44424) 2025-12-09 09:29:40 -08:00
http_client_tls
icons Improve icon selection for edit prediction providers (#47911) 2026-02-02 10:00:35 -03:00
image_viewer image_viewer: Compute better initial zoom level (#47886) 2026-01-28 23:29:25 +01:00
inspector_ui build: Simplify build graph (#47253) 2026-01-23 18:29:20 +01:00
install_cli gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
journal
json_schema_store settings: Extract project settings JSON schema (#47939) 2026-01-30 18:55:09 +00:00
keymap_editor build: Simplify build graph (#47253) 2026-01-23 18:29:20 +01:00
language Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
language_extension ztracing: Enable memory profiling and callstack sampling (#47052) 2026-01-17 19:29:19 +00:00
language_model Add support for refreshing outdated LLM tokens (#47512) 2026-01-23 21:03:28 +00:00
language_models cloud_api_types: Rework Plan type (#47784) 2026-01-27 12:15:05 -05:00
language_onboarding
language_selector build: Simplify build graph (#47253) 2026-01-23 18:29:20 +01:00
language_tools Fix incorrect memory display in the language servers menu on Linux (#48245) 2026-02-03 08:37:54 -05:00
languages languages: Remove duplicate keywords in TSX syntax highlighting (#48196) 2026-02-03 14:55:26 -05:00
line_ending_selector
livekit_api Update Rust crate jsonwebtoken to v10 [SECURITY] (#48294) 2026-02-03 15:51:40 -05:00
livekit_client livekit_client: Revert #46986 for macos (#46990) 2026-01-16 14:20:23 +00:00
lmstudio
lsp Show memory used by language servers (#48226) 2026-02-02 18:45:28 -05:00
markdown markdown: Fix markdown table selection hit testing (#47720) 2026-02-02 16:37:58 +00:00
markdown_preview Add item for opening Markdown/SVG files in preview tab in right-click menu (#47821) 2026-01-28 00:19:13 -03:00
media
menu ui: Add submenus to ContextMenu (#45743) 2025-12-30 07:49:01 -03:00
migrator Make mercury and sweep non experimental (#48227) 2026-02-02 21:13:32 -05:00
miniprofiler_ui Revert "Revert scheduler update (#46659)" (#46671) 2026-01-14 07:19:13 +00:00
mistral Update Mistral models context length to their recommended values (#45194) 2025-12-18 09:49:32 +00:00
multi_buffer multi_buffer: Reduce region clones (#48025) 2026-01-30 15:01:49 +00:00
nc smol: Use Unblock instead of Async for stdin, stdout and stderr handles (#46141) 2026-01-06 08:14:34 +00:00
net
node_runtime acp: Allow running NPM agents from registry (#47291) 2026-01-21 14:52:44 +00:00
notifications gpui: Actually remove the Result from AsyncApp (#45809) 2026-01-07 12:48:24 -08:00
ollama Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
onboarding onboarding: Fix theme picker always updating theme based on system appearance (#47245) 2026-01-21 10:12:29 +00:00
open_ai ep: Use rejected_output for DPO training + OpenAI support (#47697) 2026-01-27 13:02:40 +00:00
open_path_prompt Fix open path prompt not showing hidden files (#46965) 2026-01-31 09:57:31 +02:00
open_router
outline outline: Enable scrollbar in outline view picker (#46774) 2026-01-14 08:06:55 -03:00
outline_panel project_panel: Show Reveal in File Manager on wsl (#47288) 2026-01-22 11:24:23 +00:00
panel build: Decouple git_ui from recent_projects (#48062) 2026-02-02 13:30:07 +01:00
paths remote_server: Cleanup old server binaries on wsl (#47839) 2026-01-28 13:30:43 +01:00
picker build: Simplify build graph (#47253) 2026-01-23 18:29:20 +01:00
platform_title_bar build: Simplify build graph (#47253) 2026-01-23 18:29:20 +01:00
prettier Revert " Add vim/emacs modeline support " (#47479) 2026-01-23 15:24:37 +00:00
project project_panel: Add right-click download option for folders/files stored in remote development server (#47344) 2026-02-03 07:12:29 +00:00
project_benchmarks ep_cli: Fix "Too many open files" errors (#47243) 2026-01-20 15:41:31 -05:00
project_panel project_panel: Fix test-support feature mismatch (#48280) 2026-02-03 22:41:59 +05:30
project_symbols Revert "Revert scheduler update (#46659)" (#46671) 2026-01-14 07:19:13 +00:00
prompt_store Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
proto project_panel: Add right-click download option for folders/files stored in remote development server (#47344) 2026-02-03 07:12:29 +00:00
recent_projects Simplify error message and provide a route to Zed log (#48301) 2026-02-03 23:07:10 +00:00
refineable gpui: Make refining a Style properly refine the TextStyle (#42852) 2025-12-15 13:30:13 +00:00
release_channel
remote Use remote user from devcontainer CLI and respect shell in passwd (#48230) 2026-02-02 16:43:51 -08:00
remote_connection build: Decouple git_ui from recent_projects (#48062) 2026-02-02 13:30:07 +01:00
remote_server project_panel: Add right-click download option for folders/files stored in remote development server (#47344) 2026-02-03 07:12:29 +00:00
repl repl: Fix cursor visibility on last line after re-running cells (#48218) 2026-02-02 22:48:07 -06:00
reqwest_client Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
rich_text
rope rope: Fix an unintentional panic (#47019) 2026-01-20 12:23:17 +00:00
rpc Fix worktree trust handling of multiple projects on the same remote host (#45834) 2025-12-29 20:21:59 +00:00
rules_library build: Simplify build graph (#47253) 2026-01-23 18:29:20 +01:00
scheduler Restore run_with_clock_advancement (#46930) 2026-01-15 18:39:06 +00:00
schema_generator Add project settings schema to schema_generator CLI (#44321) 2025-12-16 10:48:14 -05:00
search git: Fix desynced scrolling between LHS and RHS of side-by-side diff (#47913) 2026-01-31 18:33:22 +00:00
session Revert "Revert scheduler update (#46659)" (#46671) 2026-01-14 07:19:13 +00:00
settings settings: Improve performance for internal editorconfig resolution (#48243) 2026-02-03 11:45:45 +05:30
settings_content Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
settings_json
settings_macros
settings_profile_selector
settings_ui Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
snippet
snippet_provider extension_cli: Validate that all snippets can be parsed (#47649) 2026-01-26 13:49:26 +00:00
snippets_ui build: Simplify build graph (#47253) 2026-01-23 18:29:20 +01:00
sqlez
sqlez_macros
story
storybook collab: Improve project and call notification UI (#47964) 2026-01-29 16:33:38 -03:00
streaming_diff
sum_tree multi_buffer: Speed up Anchor::to_offset resolution (#48021) 2026-01-30 15:01:18 +00:00
supermaven Improve icon selection for edit prediction providers (#47911) 2026-02-02 10:00:35 -03:00
supermaven_api collab: Remove Supermaven API key issuance (#46044) 2026-01-04 23:28:18 +00:00
svg_preview Add item for opening Markdown/SVG files in preview tab in right-click menu (#47821) 2026-01-28 00:19:13 -03:00
system_specs
tab_switcher tab_switcher: Fix missing preview on initial ctrl-shift-tab press (#44959) 2025-12-16 08:26:29 +00:00
task Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
tasks_ui tasks: Show error for unknown ZED_ variables (#45621) 2026-01-26 19:47:36 +00:00
telemetry
telemetry_events ep_cli: rated-after: query (#47906) 2026-01-28 16:36:44 -08:00
terminal Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
terminal_view terminal_view: Add support for opening the terminal in the current file directory (#47739) 2026-02-02 09:49:09 +01:00
text git: Refactor buffer_diff point translation APIs for more efficient side-by-side diff syncing (#48237) 2026-02-03 22:18:59 -05:00
theme Update nim entry with additional file suffixes (#47616) 2026-01-26 13:02:05 +00:00
theme_extension
theme_importer Split settings content into its own crate (#46845) 2026-01-15 18:10:21 +00:00
theme_selector Allow dynamic set_theme based on Appearance (#42812) 2025-12-01 20:52:57 -07:00
time_format time_format: Determine year difference based on months passed (#47687) 2026-01-28 17:05:34 +01:00
title_bar Add student plan (#47866) 2026-01-28 21:34:10 +00:00
toolchain_selector Added support for dismissing the toolchain path selector via esc (#48201) 2026-02-02 16:56:25 +00:00
ui nix: Use flake-parts, partitions, and treefmt-nix (#45321) 2026-02-02 14:26:42 +00:00
ui_input build: Decouple git_ui from recent_projects (#48062) 2026-02-02 13:30:07 +01:00
ui_macros
ui_prompt
util Revert "Allow always_allow patterns for Nushell, Elvish, and Rc shells" (#48050) 2026-01-30 21:26:13 +00:00
util_macros
vercel project: Move tests to integration layer (#47596) 2026-01-25 21:35:32 +01:00
vim vim: Revert changes to search (#48127) (#48234) 2026-02-03 02:46:41 +00:00
vim_mode_setting
watch
web_search
web_search_providers Add helper method for checking if the LLM token needs to be refreshed (#47511) 2026-01-23 20:50:50 +00:00
which_key Add Vim-like Which-key Popup menu (#43618) 2025-12-17 11:53:48 -07:00
workspace Use remote user from devcontainer CLI and respect shell in passwd (#48230) 2026-02-02 16:43:51 -08:00
worktree Fix git panel not updating after commit (#47222) 2026-01-31 19:15:59 +00:00
worktree_benchmarks project: Always allocate WorktreeIDs on the remote client (#47936) 2026-01-29 15:31:13 +00:00
x_ai Add support for Grok 4.1 Fast models in xAI provider (#43419) 2025-12-08 16:38:34 +01:00
zed Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
zed_actions docs: Correct action descriptions to reflect actual purpose (#46931) 2026-01-28 23:10:25 +00:00
zed_env_vars Enable configuring edit prediction providers through the settings UI (#44505) 2025-12-13 11:06:30 -05:00
zeta_prompt Add initial support for edit predictions via Ollama (#48233) 2026-02-04 01:33:12 +00:00
zlog zlog: Fix dynamic mod path filtering (#44296) 2025-12-06 17:56:49 +00:00
zlog_settings
ztracing ztracing: Enable memory profiling and callstack sampling (#47052) 2026-01-17 19:29:19 +00:00
ztracing_macro adds tracing for instrumenting non-async functions (#44147) 2025-12-05 17:23:06 +00:00