Show cursors for shared contexts (#14484)
Release Notes: - N/A Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
parent
f0279e672a
commit
e8d674dc04
1 changed files with 21 additions and 3 deletions
|
@ -595,7 +595,8 @@ impl AssistantPanel {
|
||||||
let mut editor = ContextEditor::for_context(
|
let mut editor = ContextEditor::for_context(
|
||||||
context,
|
context,
|
||||||
self.fs.clone(),
|
self.fs.clone(),
|
||||||
workspace,
|
workspace.clone(),
|
||||||
|
self.project.clone(),
|
||||||
lsp_adapter_delegate,
|
lsp_adapter_delegate,
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
|
@ -707,6 +708,7 @@ impl AssistantPanel {
|
||||||
.context_store
|
.context_store
|
||||||
.update(cx, |store, cx| store.open_local_context(path.clone(), cx));
|
.update(cx, |store, cx| store.open_local_context(path.clone(), cx));
|
||||||
let fs = self.fs.clone();
|
let fs = self.fs.clone();
|
||||||
|
let project = self.project.clone();
|
||||||
let workspace = self.workspace.clone();
|
let workspace = self.workspace.clone();
|
||||||
|
|
||||||
let lsp_adapter_delegate = workspace
|
let lsp_adapter_delegate = workspace
|
||||||
|
@ -723,7 +725,14 @@ impl AssistantPanel {
|
||||||
.upgrade()
|
.upgrade()
|
||||||
.ok_or_else(|| anyhow!("workspace dropped"))?;
|
.ok_or_else(|| anyhow!("workspace dropped"))?;
|
||||||
let editor = cx.new_view(|cx| {
|
let editor = cx.new_view(|cx| {
|
||||||
ContextEditor::for_context(context, fs, workspace, lsp_adapter_delegate, cx)
|
ContextEditor::for_context(
|
||||||
|
context,
|
||||||
|
fs,
|
||||||
|
workspace,
|
||||||
|
project,
|
||||||
|
lsp_adapter_delegate,
|
||||||
|
cx,
|
||||||
|
)
|
||||||
});
|
});
|
||||||
this.show_context(editor, cx);
|
this.show_context(editor, cx);
|
||||||
anyhow::Ok(())
|
anyhow::Ok(())
|
||||||
|
@ -770,7 +779,14 @@ impl AssistantPanel {
|
||||||
.upgrade()
|
.upgrade()
|
||||||
.ok_or_else(|| anyhow!("workspace dropped"))?;
|
.ok_or_else(|| anyhow!("workspace dropped"))?;
|
||||||
let editor = cx.new_view(|cx| {
|
let editor = cx.new_view(|cx| {
|
||||||
ContextEditor::for_context(context, fs, workspace, lsp_adapter_delegate, cx)
|
ContextEditor::for_context(
|
||||||
|
context,
|
||||||
|
fs,
|
||||||
|
workspace,
|
||||||
|
this.project.clone(),
|
||||||
|
lsp_adapter_delegate,
|
||||||
|
cx,
|
||||||
|
)
|
||||||
});
|
});
|
||||||
this.show_context(editor.clone(), cx);
|
this.show_context(editor.clone(), cx);
|
||||||
anyhow::Ok(editor)
|
anyhow::Ok(editor)
|
||||||
|
@ -961,6 +977,7 @@ impl ContextEditor {
|
||||||
context: Model<Context>,
|
context: Model<Context>,
|
||||||
fs: Arc<dyn Fs>,
|
fs: Arc<dyn Fs>,
|
||||||
workspace: View<Workspace>,
|
workspace: View<Workspace>,
|
||||||
|
project: Model<Project>,
|
||||||
lsp_adapter_delegate: Option<Arc<dyn LspAdapterDelegate>>,
|
lsp_adapter_delegate: Option<Arc<dyn LspAdapterDelegate>>,
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
@ -979,6 +996,7 @@ impl ContextEditor {
|
||||||
editor.set_show_wrap_guides(false, cx);
|
editor.set_show_wrap_guides(false, cx);
|
||||||
editor.set_show_indent_guides(false, cx);
|
editor.set_show_indent_guides(false, cx);
|
||||||
editor.set_completion_provider(Box::new(completion_provider));
|
editor.set_completion_provider(Box::new(completion_provider));
|
||||||
|
editor.set_collaboration_hub(Box::new(project));
|
||||||
editor
|
editor
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue