Decouple extension Worktree
resource from LspAdapterDelegate
(#20611)
This PR decouples the extension `Worktree` resource from the `LspAdapterDelegate`. We now have a `WorktreeDelegate` trait that corresponds to the methods on the resource. We then create a `WorktreeDelegateAdapter` that can wrap an `LspAdapterDelegate` and implement the `WorktreeDelegate` trait. Release Notes: - N/A
This commit is contained in:
parent
f96b29ca54
commit
a04c2ecff7
9 changed files with 93 additions and 76 deletions
|
@ -5,6 +5,7 @@ use assistant_slash_command::{
|
|||
ArgumentCompletion, SlashCommand, SlashCommandOutput, SlashCommandOutputSection,
|
||||
SlashCommandResult,
|
||||
};
|
||||
use extension_host::extension_lsp_adapter::WorktreeDelegateAdapter;
|
||||
use futures::FutureExt as _;
|
||||
use gpui::{Task, WeakView, WindowContext};
|
||||
use language::{BufferSnapshot, LspAdapterDelegate};
|
||||
|
@ -97,6 +98,8 @@ impl SlashCommand for ExtensionSlashCommand {
|
|||
move |extension, store| {
|
||||
async move {
|
||||
let resource = if let Some(delegate) = delegate {
|
||||
let delegate =
|
||||
Arc::new(WorktreeDelegateAdapter(delegate.clone())) as _;
|
||||
Some(store.data_mut().table().push(delegate)?)
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue