mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 14:17:02 +00:00
Register ESLint as an available language server (#11178)
This PR adds the ability for the ESLint language server (`eslint`) to be controlled by the `language_servers` setting. Now in your settings you can indicate that the ESLint language server should be used for a given language, even if that language does not have the ESLint language server registered for it already: ```json { "languages": { "My Language": { "language_servers": ["eslint", "..."] } } } ``` Release Notes: - N/A
This commit is contained in:
parent
ec95605fec
commit
9ff847753e
1 changed files with 7 additions and 3 deletions
|
@ -165,10 +165,10 @@ pub fn init(
|
||||||
);
|
);
|
||||||
language!("proto");
|
language!("proto");
|
||||||
|
|
||||||
// Register Tailwind globally as an available language server.
|
// Register globally available language servers.
|
||||||
//
|
//
|
||||||
// This will allow users to add Tailwind support for a given language via
|
// This will allow users to add support for a built-in language server (e.g., Tailwind)
|
||||||
// the `language_servers` setting:
|
// for a given language via the `language_servers` setting:
|
||||||
//
|
//
|
||||||
// ```json
|
// ```json
|
||||||
// {
|
// {
|
||||||
|
@ -186,6 +186,10 @@ pub fn init(
|
||||||
move || Arc::new(tailwind::TailwindLspAdapter::new(node_runtime.clone()))
|
move || Arc::new(tailwind::TailwindLspAdapter::new(node_runtime.clone()))
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
languages.register_available_lsp_adapter(LanguageServerName("eslint".into()), {
|
||||||
|
let node_runtime = node_runtime.clone();
|
||||||
|
move || Arc::new(typescript::EsLintLspAdapter::new(node_runtime.clone()))
|
||||||
|
});
|
||||||
|
|
||||||
// Register Tailwind for the existing languages that should have it by default.
|
// Register Tailwind for the existing languages that should have it by default.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue