Skip to content

Commit

Permalink
Fix some issues with branch buffers (zed-industries#18945)
Browse files Browse the repository at this point in the history
* `Open Excerpts` command always opens the locations in the base buffer
* LSP features like document-highlights, go-to-def, and inlay hints work
correctly in branch buffers
* Other LSP features like completions, code actions, and rename are
disabled in branch buffers

Release Notes:

- N/A
  • Loading branch information
maxbrunsfeld authored and noaccOS committed Oct 19, 2024
1 parent c249c4e commit 1c613e6
Show file tree
Hide file tree
Showing 13 changed files with 555 additions and 268 deletions.
2 changes: 1 addition & 1 deletion crates/assistant/src/assistant_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,7 @@ impl ContextEditor {
editor.set_show_runnables(false, cx);
editor.set_show_wrap_guides(false, cx);
editor.set_show_indent_guides(false, cx);
editor.set_completion_provider(Box::new(completion_provider));
editor.set_completion_provider(Some(Box::new(completion_provider)));
editor.set_collaboration_hub(Box::new(project.clone()));
editor
});
Expand Down
4 changes: 2 additions & 2 deletions crates/assistant/src/prompt_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,9 @@ impl PromptLibrary {
editor.set_show_indent_guides(false, cx);
editor.set_use_modal_editing(false);
editor.set_current_line_highlight(Some(CurrentLineHighlight::None));
editor.set_completion_provider(Box::new(
editor.set_completion_provider(Some(Box::new(
SlashCommandCompletionProvider::new(None, None),
));
)));
if focus {
editor.focus(cx);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/collab_ui/src/chat_panel/message_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl MessageEditor {
editor.set_show_gutter(false, cx);
editor.set_show_wrap_guides(false, cx);
editor.set_show_indent_guides(false, cx);
editor.set_completion_provider(Box::new(MessageEditorCompletionProvider(this)));
editor.set_completion_provider(Some(Box::new(MessageEditorCompletionProvider(this))));
editor.set_auto_replace_emoji_shortcode(
MessageEditorSettings::get_global(cx)
.auto_replace_emoji_shortcode
Expand Down
Loading

0 comments on commit 1c613e6

Please sign in to comment.