Rename LspAdapterTrait to LspAdapter and LspAdapter to CachedLspAdapter
This commit is contained in:
@@ -11,7 +11,7 @@ use util::ResultExt;
|
||||
pub struct CLspAdapter;
|
||||
|
||||
#[async_trait]
|
||||
impl super::LspAdapterTrait for CLspAdapter {
|
||||
impl super::LspAdapter for CLspAdapter {
|
||||
async fn name(&self) -> LanguageServerName {
|
||||
LanguageServerName("clangd".into())
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ lazy_static! {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl super::LspAdapterTrait for GoLspAdapter {
|
||||
impl super::LspAdapter for GoLspAdapter {
|
||||
async fn name(&self) -> LanguageServerName {
|
||||
LanguageServerName("gopls".into())
|
||||
}
|
||||
@@ -314,7 +314,7 @@ mod tests {
|
||||
let language = language(
|
||||
"go",
|
||||
tree_sitter_go::language(),
|
||||
Some(LspAdapter::new(GoLspAdapter).await),
|
||||
Some(CachedLspAdapter::new(GoLspAdapter).await),
|
||||
);
|
||||
|
||||
let theme = SyntaxTheme::new(vec![
|
||||
|
||||
@@ -3,7 +3,7 @@ use async_trait::async_trait;
|
||||
use client::http::HttpClient;
|
||||
use futures::lock::Mutex;
|
||||
use gpui::executor::Background;
|
||||
use language::{LanguageServerName, LspAdapterTrait};
|
||||
use language::{LanguageServerName, LspAdapter};
|
||||
use plugin_runtime::{Plugin, PluginBuilder, WasiFn};
|
||||
use std::{any::Any, path::PathBuf, sync::Arc};
|
||||
use util::ResultExt;
|
||||
@@ -55,7 +55,7 @@ impl PluginLspAdapter {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl LspAdapterTrait for PluginLspAdapter {
|
||||
impl LspAdapter for PluginLspAdapter {
|
||||
async fn name(&self) -> LanguageServerName {
|
||||
let name: String = self
|
||||
.runtime
|
||||
|
||||
@@ -3,7 +3,7 @@ use anyhow::{anyhow, Context, Result};
|
||||
use async_trait::async_trait;
|
||||
use client::http::HttpClient;
|
||||
use futures::StreamExt;
|
||||
use language::{LanguageServerName, LspAdapterTrait};
|
||||
use language::{LanguageServerName, LspAdapter};
|
||||
use smol::fs;
|
||||
use std::{any::Any, path::PathBuf, sync::Arc};
|
||||
use util::ResultExt;
|
||||
@@ -15,7 +15,7 @@ impl PythonLspAdapter {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl LspAdapterTrait for PythonLspAdapter {
|
||||
impl LspAdapter for PythonLspAdapter {
|
||||
async fn name(&self) -> LanguageServerName {
|
||||
LanguageServerName("pyright".into())
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ use util::ResultExt;
|
||||
pub struct RustLspAdapter;
|
||||
|
||||
#[async_trait]
|
||||
impl LspAdapterTrait for RustLspAdapter {
|
||||
impl LspAdapter for RustLspAdapter {
|
||||
async fn name(&self) -> LanguageServerName {
|
||||
LanguageServerName("rust-analyzer".into())
|
||||
}
|
||||
@@ -255,7 +255,7 @@ impl LspAdapterTrait for RustLspAdapter {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::languages::{language, LspAdapter};
|
||||
use crate::languages::{language, CachedLspAdapter};
|
||||
use gpui::{color::Color, MutableAppContext};
|
||||
use theme::SyntaxTheme;
|
||||
|
||||
@@ -305,7 +305,7 @@ mod tests {
|
||||
let language = language(
|
||||
"rust",
|
||||
tree_sitter_rust::language(),
|
||||
Some(LspAdapter::new(RustLspAdapter).await),
|
||||
Some(CachedLspAdapter::new(RustLspAdapter).await),
|
||||
);
|
||||
let grammar = language.grammar().unwrap();
|
||||
let theme = SyntaxTheme::new(vec![
|
||||
@@ -390,7 +390,7 @@ mod tests {
|
||||
let language = language(
|
||||
"rust",
|
||||
tree_sitter_rust::language(),
|
||||
Some(LspAdapter::new(RustLspAdapter).await),
|
||||
Some(CachedLspAdapter::new(RustLspAdapter).await),
|
||||
);
|
||||
let grammar = language.grammar().unwrap();
|
||||
let theme = SyntaxTheme::new(vec![
|
||||
|
||||
@@ -3,7 +3,7 @@ use anyhow::{anyhow, Context, Result};
|
||||
use async_trait::async_trait;
|
||||
use client::http::HttpClient;
|
||||
use futures::StreamExt;
|
||||
use language::{LanguageServerName, LspAdapterTrait};
|
||||
use language::{LanguageServerName, LspAdapter};
|
||||
use serde_json::json;
|
||||
use smol::fs;
|
||||
use std::{any::Any, path::PathBuf, sync::Arc};
|
||||
@@ -21,7 +21,7 @@ struct Versions {
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl LspAdapterTrait for TypeScriptLspAdapter {
|
||||
impl LspAdapter for TypeScriptLspAdapter {
|
||||
async fn name(&self) -> LanguageServerName {
|
||||
LanguageServerName("typescript-language-server".into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user