Going to move LspAdapter from trait to struct
This commit is contained in:
parent
e4a680f47b
commit
602fe14aa4
2 changed files with 20 additions and 0 deletions
|
@ -65,6 +65,23 @@ pub struct LanguageServerName(pub Arc<str>);
|
|||
|
||||
use async_trait::async_trait;
|
||||
|
||||
// pub struct LspAdapter {
|
||||
// name: LanguageServerName,
|
||||
// adapter: Arc<dyn LspAdapter>,
|
||||
// }
|
||||
|
||||
// impl LspAdapter {
|
||||
// async fn new(adapter: Arc<dyn LspAdapter>) -> Self {
|
||||
// let name = adapter.name().await;
|
||||
|
||||
// LspAdapter { name, adapter }
|
||||
// }
|
||||
|
||||
// fn name(&self) -> LanguageServerName {
|
||||
// self.name
|
||||
// }
|
||||
// }
|
||||
|
||||
#[async_trait]
|
||||
pub trait LspAdapter: 'static + Send + Sync {
|
||||
async fn name(&self) -> LanguageServerName;
|
||||
|
|
|
@ -1787,6 +1787,7 @@ impl Project {
|
|||
))?,
|
||||
}
|
||||
cx.subscribe(buffer, |this, buffer, event, cx| {
|
||||
// TODO(isaac): should this be done in the background?
|
||||
this.on_buffer_event(buffer, event, cx).await;
|
||||
})
|
||||
.detach();
|
||||
|
@ -3310,6 +3311,7 @@ impl Project {
|
|||
return Ok(Default::default());
|
||||
};
|
||||
|
||||
// TODO(isaac): also use join_all
|
||||
struct PartialSymbol {
|
||||
source_worktree_id: WorktreeId,
|
||||
worktree_id: WorktreeId,
|
||||
|
@ -3537,6 +3539,7 @@ impl Project {
|
|||
Default::default()
|
||||
};
|
||||
|
||||
// TODO(isaac): use futures::future::join_all
|
||||
struct PartialCompletion {
|
||||
pub old_range: Range<Anchor>,
|
||||
pub new_text: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue