Move adapters to remote (#18359)
Release Notes: - ssh remoting: run LSP Adapters on host --------- Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
40408e731e
commit
64532e94e4
10 changed files with 76 additions and 548 deletions
|
@ -10,6 +10,25 @@ workspace = true
|
|||
|
||||
[features]
|
||||
test-support = []
|
||||
load-grammars = [
|
||||
"tree-sitter-bash",
|
||||
"tree-sitter-c",
|
||||
"tree-sitter-cpp",
|
||||
"tree-sitter-css",
|
||||
"tree-sitter-go",
|
||||
"tree-sitter-go-mod",
|
||||
"tree-sitter-gowork",
|
||||
"tree-sitter-jsdoc",
|
||||
"tree-sitter-json",
|
||||
"tree-sitter-md",
|
||||
"protols-tree-sitter-proto",
|
||||
"tree-sitter-python",
|
||||
"tree-sitter-regex",
|
||||
"tree-sitter-rust",
|
||||
"tree-sitter-typescript",
|
||||
"tree-sitter-yaml",
|
||||
"tree-sitter"
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
|
@ -36,25 +55,26 @@ settings.workspace = true
|
|||
smol.workspace = true
|
||||
task.workspace = true
|
||||
toml.workspace = true
|
||||
tree-sitter-bash.workspace = true
|
||||
tree-sitter-c.workspace = true
|
||||
tree-sitter-cpp.workspace = true
|
||||
tree-sitter-css.workspace = true
|
||||
tree-sitter-go.workspace = true
|
||||
tree-sitter-go-mod.workspace = true
|
||||
tree-sitter-gowork.workspace = true
|
||||
tree-sitter-jsdoc.workspace = true
|
||||
tree-sitter-json.workspace = true
|
||||
tree-sitter-md.workspace = true
|
||||
protols-tree-sitter-proto.workspace = true
|
||||
tree-sitter-python.workspace = true
|
||||
tree-sitter-regex.workspace = true
|
||||
tree-sitter-rust.workspace = true
|
||||
tree-sitter-typescript.workspace = true
|
||||
tree-sitter-yaml.workspace = true
|
||||
tree-sitter.workspace = true
|
||||
util.workspace = true
|
||||
|
||||
tree-sitter-bash = {workspace = true, optional = true}
|
||||
tree-sitter-c = {workspace = true, optional = true}
|
||||
tree-sitter-cpp = {workspace = true, optional = true}
|
||||
tree-sitter-css = {workspace = true, optional = true}
|
||||
tree-sitter-go = {workspace = true, optional = true}
|
||||
tree-sitter-go-mod = {workspace = true, optional = true}
|
||||
tree-sitter-gowork = {workspace = true, optional = true}
|
||||
tree-sitter-jsdoc = {workspace = true, optional = true}
|
||||
tree-sitter-json = {workspace = true, optional = true}
|
||||
tree-sitter-md = {workspace = true, optional = true}
|
||||
protols-tree-sitter-proto = {workspace = true, optional = true}
|
||||
tree-sitter-python = {workspace = true, optional = true}
|
||||
tree-sitter-regex = {workspace = true, optional = true}
|
||||
tree-sitter-rust = {workspace = true, optional = true}
|
||||
tree-sitter-typescript = {workspace = true, optional = true}
|
||||
tree-sitter-yaml = {workspace = true, optional = true}
|
||||
tree-sitter = {workspace = true, optional = true}
|
||||
|
||||
[dev-dependencies]
|
||||
text.workspace = true
|
||||
theme = { workspace = true, features = ["test-support"] }
|
||||
|
|
|
@ -31,6 +31,7 @@ mod yaml;
|
|||
struct LanguageDir;
|
||||
|
||||
pub fn init(languages: Arc<LanguageRegistry>, node_runtime: NodeRuntime, cx: &mut AppContext) {
|
||||
#[cfg(feature = "load-grammars")]
|
||||
languages.register_native_grammars([
|
||||
("bash", tree_sitter_bash::LANGUAGE),
|
||||
("c", tree_sitter_c::LANGUAGE),
|
||||
|
@ -282,9 +283,21 @@ fn load_config(name: &str) -> LanguageConfig {
|
|||
)
|
||||
.unwrap();
|
||||
|
||||
::toml::from_str(&config_toml)
|
||||
#[allow(unused_mut)]
|
||||
let mut config: LanguageConfig = ::toml::from_str(&config_toml)
|
||||
.with_context(|| format!("failed to load config.toml for language {name:?}"))
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
#[cfg(not(feature = "load-grammars"))]
|
||||
{
|
||||
config = LanguageConfig {
|
||||
name: config.name,
|
||||
matcher: config.matcher,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
config
|
||||
}
|
||||
|
||||
fn load_queries(name: &str) -> LanguageQueries {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue