Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when trying to open a proposed changes editor with a reverse selection #18589

Closed
1 task done
maxdeviant opened this issue Oct 1, 2024 · 0 comments · Fixed by #18599
Closed
1 task done

Panic when trying to open a proposed changes editor with a reverse selection #18589

maxdeviant opened this issue Oct 1, 2024 · 0 comments · Fixed by #18599
Labels
bug [core label] editor Feedback for code editing, formatting, editor iterations, etc panic / crash [core label]

Comments

@maxdeviant
Copy link
Member

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I noticed a panic that could occur when trying to open a proposed changes editor with a reversed selection:

  1. Open any file
  2. Create a selection by placing your cursor on a line and then selecting upwards in the buffer
  3. Open a proposed changes editor with editor: open proposed changes editor
  4. 💥

Here's the stack trace:

Thread "main" panicked with "assertion failed: end_offset >= self.offset" at /Users/maxdeviant/projects/zed/crates/rope/src/rope.rs:522:9
   0: backtrace::backtrace::libunwind::trace
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/libunwind.rs:116:5
      backtrace::backtrace::trace_unsynchronized::<<backtrace::capture::Backtrace>::create::{closure#0}>
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace::<<backtrace::capture::Backtrace>::create::{closure#0}>
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/mod.rs:53:14
   2: <backtrace::capture::Backtrace>::create
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/capture.rs:292:9
   3: <backtrace::capture::Backtrace>::new
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/capture.rs:257:22
   4: zed::reliability::init_panic_hook::{closure#0}
             at /Users/maxdeviant/projects/zed/crates/zed/src/reliability.rs:58:29
   5: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2084:9
      std::panicking::rust_panic_with_hook
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:808:13
   6: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:667:13
   7: std::sys::backtrace::__rust_end_short_backtrace
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:168:18
   8: rust_begin_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
   9: core::panicking::panic_fmt
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
  10: core::panicking::panic
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:148:5
  11: <rope::Cursor>::summary::<rope::TextSummary>
             at /Users/maxdeviant/projects/zed/crates/rope/src/rope.rs:522:9
  12: <text::BufferSnapshot>::text_summary_for_range::<rope::TextSummary, usize>
             at /Users/maxdeviant/projects/zed/crates/text/src/text.rs:2102:9
  13: <multi_buffer::Excerpt>::new
             at /Users/maxdeviant/projects/zed/crates/multi_buffer/src/multi_buffer.rs:4376:27
  14: <multi_buffer::MultiBuffer>::insert_excerpts_with_ids_after::<rope::point::Point, core::iter::adapters::map::Map<core::iter::adapters::map::Map<alloc::vec::into_iter::IntoIter<core::ops::range::Range<rope::point::Point>>, <editor::proposed_changes_editor::ProposedChangesEditor>::new<rope::point::Point>::{closure#2}::{closure#0}>, <multi_buffer::MultiBuffer>::insert_excerpts_after<rope::point::Point, core::iter::adapters::map::Map<alloc::vec::into_iter::IntoIter<core::ops::range::Range<rope::point::Point>>, <editor::proposed_changes_editor::ProposedChangesEditor>::new<rope::point::Point>::{closure#2}::{closure#0}>>::{closure#0}>>
             at /Users/maxdeviant/projects/zed/crates/multi_buffer/src/multi_buffer.rs:1366:27
  15: <multi_buffer::MultiBuffer>::insert_excerpts_after::<rope::point::Point, core::iter::adapters::map::Map<alloc::vec::into_iter::IntoIter<core::ops::range::Range<rope::point::Point>>, <editor::proposed_changes_editor::ProposedChangesEditor>::new<rope::point::Point>::{closure#2}::{closure#0}>>
             at /Users/maxdeviant/projects/zed/crates/multi_buffer/src/multi_buffer.rs:1284:9
  16: <multi_buffer::MultiBuffer>::push_excerpts::<rope::point::Point, core::iter::adapters::map::Map<alloc::vec::into_iter::IntoIter<core::ops::range::Range<rope::point::Point>>, <editor::proposed_changes_editor::ProposedChangesEditor>::new<rope::point::Point>::{closure#2}::{closure#0}>>
             at /Users/maxdeviant/projects/zed/crates/multi_buffer/src/multi_buffer.rs:1142:9
  17: <editor::proposed_changes_editor::ProposedChangesEditor>::new::<rope::point::Point>::{closure#2}
             at /Users/maxdeviant/projects/zed/crates/editor/src/proposed_changes_editor.rs:47:17
  18: <gpui::window::WindowContext as gpui::Context>::update_model::<multi_buffer::MultiBuffer, (), <editor::proposed_changes_editor::ProposedChangesEditor>::new<rope::point::Point>::{closure#2}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:3824:22
  19: <gpui::window::ViewContext<editor::proposed_changes_editor::ProposedChangesEditor> as gpui::Context>::update_model::<multi_buffer::MultiBuffer, (), <editor::proposed_changes_editor::ProposedChangesEditor>::new<rope::point::Point>::{closure#2}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:4532:9
  20: <gpui::app::entity_map::Model<multi_buffer::MultiBuffer>>::update::<gpui::window::ViewContext<editor::proposed_changes_editor::ProposedChangesEditor>, (), <editor::proposed_changes_editor::ProposedChangesEditor>::new<rope::point::Point>::{closure#2}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app/entity_map.rs:422:9
  21: <editor::proposed_changes_editor::ProposedChangesEditor>::new::<rope::point::Point>
             at /Users/maxdeviant/projects/zed/crates/editor/src/proposed_changes_editor.rs:46:13
  22: <editor::Editor>::open_proposed_changes_editor::{closure#1}
             at /Users/maxdeviant/projects/zed/crates/editor/src/editor.rs:12267:13
  23: <gpui::window::WindowContext as gpui::VisualContext>::new_view::<editor::proposed_changes_editor::ProposedChangesEditor, <editor::Editor>::open_proposed_changes_editor::{closure#1}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:3892:22
  24: <gpui::window::ViewContext<editor::Editor> as gpui::VisualContext>::new_view::<editor::proposed_changes_editor::ProposedChangesEditor, <editor::Editor>::open_proposed_changes_editor::{closure#1}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:4570:9
  25: <editor::Editor>::open_proposed_changes_editor
             at /Users/maxdeviant/projects/zed/crates/editor/src/editor.rs:12266:39
  26: <<editor::Editor>::open_proposed_changes_editor as core::ops::function::Fn<(&mut editor::Editor, &editor::actions::OpenProposedChangesEditor, &mut gpui::window::ViewContext<editor::Editor>)>>::call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:79:5
  27: editor::element::register_action::<editor::actions::OpenProposedChangesEditor, <editor::Editor>::open_proposed_changes_editor>::{closure#0}::{closure#0}
             at /Users/maxdeviant/projects/zed/crates/editor/src/element.rs:6283:17
  28: <gpui::window::WindowContext as gpui::VisualContext>::update_view::<editor::Editor, (), editor::element::register_action<editor::actions::OpenProposedChangesEditor, <editor::Editor>::open_proposed_changes_editor>::{closure#0}::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:3916:22
  29: <gpui::view::View<editor::Editor>>::update::<gpui::window::WindowContext, (), editor::element::register_action<editor::actions::OpenProposedChangesEditor, <editor::Editor>::open_proposed_changes_editor>::{closure#0}::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/view.rs:76:9
  30: editor::element::register_action::<editor::actions::OpenProposedChangesEditor, <editor::Editor>::open_proposed_changes_editor>::{closure#0}
             at /Users/maxdeviant/projects/zed/crates/editor/src/element.rs:6282:13
  31: <gpui::window::WindowContext>::dispatch_action_on_node
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:3544:21
  32: <gpui::window::WindowContext>::dispatch_action::{closure#0}::{closure#0}
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:1023:21
  33: <gpui::app::AppContext as gpui::Context>::update_window::<(), <gpui::window::WindowContext>::dispatch_action::{closure#0}::{closure#0}>::{closure#0}
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app.rs:1401:26
  34: <gpui::app::AppContext>::update::<core::result::Result<(), anyhow::Error>, <gpui::app::AppContext as gpui::Context>::update_window<(), <gpui::window::WindowContext>::dispatch_action::{closure#0}::{closure#0}>::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app.rs:363:22
  35: <gpui::app::AppContext as gpui::Context>::update_window::<(), <gpui::window::WindowContext>::dispatch_action::{closure#0}::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app.rs:1392:9
  36: <gpui::window::AnyWindowHandle>::update::<gpui::app::AppContext, (), <gpui::window::WindowContext>::dispatch_action::{closure#0}::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:4806:9
  37: <gpui::window::WindowContext>::dispatch_action::{closure#0}
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:1012:13
  38: <<gpui::window::WindowContext>::dispatch_action::{closure#0} as core::ops::function::FnOnce<(&mut gpui::app::AppContext,)>>::call_once::{shim:vtable#0}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250:5
  39: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a mut gpui::app::AppContext,), Output = ()>> as core::ops::function::FnOnce<(&mut gpui::app::AppContext,)>>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070:9
  40: <gpui::app::AppContext>::apply_defer_effect
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app.rs:852:9
  41: <gpui::app::AppContext>::flush_effects
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app.rs:746:25
  42: <gpui::app::AppContext>::update::<core::result::Result<gpui::window::DispatchEventResult, anyhow::Error>, <gpui::app::AppContext as gpui::Context>::update_window<gpui::window::DispatchEventResult, <gpui::window::Window>::new::{closure#10}::{closure#0}>::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app.rs:366:13
  43: <gpui::app::AppContext as gpui::Context>::update_window::<gpui::window::DispatchEventResult, <gpui::window::Window>::new::{closure#10}::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app.rs:1392:9
  44: <gpui::app::async_context::AsyncAppContext as gpui::Context>::update_window::<gpui::window::DispatchEventResult, <gpui::window::Window>::new::{closure#10}::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app/async_context.rs:91:9
  45: <gpui::window::AnyWindowHandle>::update::<gpui::app::async_context::AsyncAppContext, gpui::window::DispatchEventResult, <gpui::window::Window>::new::{closure#10}::{closure#0}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:4806:9
  46: <gpui::window::Window>::new::{closure#10}
             at /Users/maxdeviant/projects/zed/crates/gpui/src/window.rs:775:17
  47: <alloc::boxed::Box<dyn core::ops::function::FnMut<(gpui::interactive::PlatformInput,), Output = gpui::window::DispatchEventResult>> as core::ops::function::FnMut<(gpui::interactive::PlatformInput,)>>::call_mut
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2077:9
  48: gpui::platform::mac::window::handle_key_event
             at /Users/maxdeviant/projects/zed/crates/gpui/src/platform/mac/window.rs:1308:28
  49: gpui::platform::mac::window::handle_key_down
             at /Users/maxdeviant/projects/zed/crates/gpui/src/platform/mac/window.rs:1208:5
  50: <unknown>
  51: <unknown>
  52: <unknown>
  53: <unknown>
  54: <unknown>
  55: <() as objc::message::MessageArguments>::invoke::<()>
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc-0.2.7/src/message/mod.rs:128:17
  56: objc::message::platform::send_unverified::<objc::runtime::Object, (), ()>
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc-0.2.7/src/message/apple/mod.rs:27:9
  57: objc::message::send_message::<objc::runtime::Object, (), ()>
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc-0.2.7/src/message/mod.rs:178:5
      <*mut objc::runtime::Object as cocoa::appkit::NSApplication>::run
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.26.0/src/appkit.rs:628:9
  58: <gpui::platform::mac::platform::MacPlatform as gpui::platform::Platform>::run
             at /Users/maxdeviant/projects/zed/crates/gpui/src/platform/mac/platform.rs:427:13
  59: <gpui::app::App>::run::<zed::main::{closure#5}>
             at /Users/maxdeviant/projects/zed/crates/gpui/src/app.rs:161:9
  60: zed::main
             at /Users/maxdeviant/projects/zed/crates/zed/src/main.rs:447:5
  61: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250:5
  62: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:152:18
  63: std::rt::lang_start::<()>::{closure#0}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/rt.rs:162:18
  64: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:284:13
      std::panicking::try::do_call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557:40
      std::panicking::try
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521:19
      std::panic::catch_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350:14
      std::rt::lang_start_internal::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/rt.rs:141:48
      std::panicking::try::do_call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557:40
      std::panicking::try
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521:19
      std::panic::catch_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350:14
      std::rt::lang_start_internal
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/rt.rs:141:20
  65: std::rt::lang_start::<()>
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/rt.rs:161:17
  66: _main

Environment

Zed: v0.156.0 (Zed Nightly 72be8c5)
OS: macOS 14.4.0
Memory: 128 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

@maxdeviant maxdeviant added bug [core label] triage labels Oct 1, 2024
@JosephTLyons JosephTLyons added panic / crash [core label] editor Feedback for code editing, formatting, editor iterations, etc and removed triage labels Oct 1, 2024
maxdeviant added a commit that referenced this issue Oct 17, 2024
…editor (#18240)

This changes the `/workflow` command so that instead of emitting edits
in separate steps, the user is presented with a single tab, with an
editable diff that they can apply to the buffer.

Todo

* Assistant panel
* [x] Show a patch title and a list of changed files in a block
decoration
* [x] Don't store resolved patches as state on Context. Resolve on
demand.
    * [ ] Better presentation of patches in the panel
    * [ ] Show a spinner while patch is streaming in
* Patches
* [x] Preserve leading whitespace in new text, auto-indent insertions
    * [x] Ensure patch title is very short, to fit better in tab
* [x] Improve patch location resolution, prefer skipping whitespace over
skipping `}`
    * [x] Ensure patch edits are auto-indented properly
* [ ] Apply `Update` edits via a diff between the old and new text, to
get fine-grained edits.
* Proposed changes editor
    * [x] Show patch title in the tab
    * [x] Add a toolbar with an "Apply all" button
* [x] Make `open excerpts` open the corresponding location in the base
buffer (#18591)
* [x] Add an apply button above every hunk
(#18592)
* [x] Expand all diff hunks by default
(#18598)
    * [x] Fix #18589
* [x] Syntax highlighting doesn't work until the buffer is edited
(#18648)
* [x] Disable LSP interaction in Proposed Changes editor
(#18945)
* [x] No auto-indent? (#18984)
* Prompt
    * [ ] make sure old_text is unique

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
mikayla-maki pushed a commit that referenced this issue Oct 18, 2024
…editor (#18240)

This changes the `/workflow` command so that instead of emitting edits
in separate steps, the user is presented with a single tab, with an
editable diff that they can apply to the buffer.

Todo

* Assistant panel
* [x] Show a patch title and a list of changed files in a block
decoration
* [x] Don't store resolved patches as state on Context. Resolve on
demand.
    * [ ] Better presentation of patches in the panel
    * [ ] Show a spinner while patch is streaming in
* Patches
* [x] Preserve leading whitespace in new text, auto-indent insertions
    * [x] Ensure patch title is very short, to fit better in tab
* [x] Improve patch location resolution, prefer skipping whitespace over
skipping `}`
    * [x] Ensure patch edits are auto-indented properly
* [ ] Apply `Update` edits via a diff between the old and new text, to
get fine-grained edits.
* Proposed changes editor
    * [x] Show patch title in the tab
    * [x] Add a toolbar with an "Apply all" button
* [x] Make `open excerpts` open the corresponding location in the base
buffer (#18591)
* [x] Add an apply button above every hunk
(#18592)
* [x] Expand all diff hunks by default
(#18598)
    * [x] Fix #18589
* [x] Syntax highlighting doesn't work until the buffer is edited
(#18648)
* [x] Disable LSP interaction in Proposed Changes editor
(#18945)
* [x] No auto-indent? (#18984)
* Prompt
    * [ ] make sure old_text is unique

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
noaccOS pushed a commit to noaccOS/zed that referenced this issue Oct 19, 2024
noaccOS pushed a commit to noaccOS/zed that referenced this issue Oct 19, 2024
…editor (zed-industries#18240)

This changes the `/workflow` command so that instead of emitting edits
in separate steps, the user is presented with a single tab, with an
editable diff that they can apply to the buffer.

Todo

* Assistant panel
* [x] Show a patch title and a list of changed files in a block
decoration
* [x] Don't store resolved patches as state on Context. Resolve on
demand.
    * [ ] Better presentation of patches in the panel
    * [ ] Show a spinner while patch is streaming in
* Patches
* [x] Preserve leading whitespace in new text, auto-indent insertions
    * [x] Ensure patch title is very short, to fit better in tab
* [x] Improve patch location resolution, prefer skipping whitespace over
skipping `}`
    * [x] Ensure patch edits are auto-indented properly
* [ ] Apply `Update` edits via a diff between the old and new text, to
get fine-grained edits.
* Proposed changes editor
    * [x] Show patch title in the tab
    * [x] Add a toolbar with an "Apply all" button
* [x] Make `open excerpts` open the corresponding location in the base
buffer (zed-industries#18591)
* [x] Add an apply button above every hunk
(zed-industries#18592)
* [x] Expand all diff hunks by default
(zed-industries#18598)
    * [x] Fix zed-industries#18589
* [x] Syntax highlighting doesn't work until the buffer is edited
(zed-industries#18648)
* [x] Disable LSP interaction in Proposed Changes editor
(zed-industries#18945)
* [x] No auto-indent? (zed-industries#18984)
* Prompt
    * [ ] make sure old_text is unique

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
osiewicz pushed a commit that referenced this issue Oct 22, 2024
…editor (#18240)

This changes the `/workflow` command so that instead of emitting edits
in separate steps, the user is presented with a single tab, with an
editable diff that they can apply to the buffer.

Todo

* Assistant panel
* [x] Show a patch title and a list of changed files in a block
decoration
* [x] Don't store resolved patches as state on Context. Resolve on
demand.
    * [ ] Better presentation of patches in the panel
    * [ ] Show a spinner while patch is streaming in
* Patches
* [x] Preserve leading whitespace in new text, auto-indent insertions
    * [x] Ensure patch title is very short, to fit better in tab
* [x] Improve patch location resolution, prefer skipping whitespace over
skipping `}`
    * [x] Ensure patch edits are auto-indented properly
* [ ] Apply `Update` edits via a diff between the old and new text, to
get fine-grained edits.
* Proposed changes editor
    * [x] Show patch title in the tab
    * [x] Add a toolbar with an "Apply all" button
* [x] Make `open excerpts` open the corresponding location in the base
buffer (#18591)
* [x] Add an apply button above every hunk
(#18592)
* [x] Expand all diff hunks by default
(#18598)
    * [x] Fix #18589
* [x] Syntax highlighting doesn't work until the buffer is edited
(#18648)
* [x] Disable LSP interaction in Proposed Changes editor
(#18945)
* [x] No auto-indent? (#18984)
* Prompt
    * [ ] make sure old_text is unique

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] editor Feedback for code editing, formatting, editor iterations, etc panic / crash [core label]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants