mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
deno: wire up LSP settings (#14410)
Currently deno lsp only works because deno have a workaround when it detects deno.json it gets activated, but without a deno.json it won't work With this change now it works correctly regardless of a deno.json presence, it only require enable:true: ```json { "lsp": { "deno": { "settings": { "deno": { "enable": true } } } } } ``` Release Notes: - Improved initial Deno set-up to enable it without explicit deno.json present in the file system
This commit is contained in:
parent
3a410942b4
commit
e5dc6beace
@ -1,6 +1,7 @@
|
||||
use std::fs;
|
||||
use zed::lsp::CompletionKind;
|
||||
use zed::{serde_json, CodeLabel, CodeLabelSpan, LanguageServerId};
|
||||
use zed_extension_api::settings::LspSettings;
|
||||
use zed_extension_api::{self as zed, Result};
|
||||
|
||||
struct DenoExtension {
|
||||
@ -117,6 +118,18 @@ impl zed::Extension for DenoExtension {
|
||||
})))
|
||||
}
|
||||
|
||||
fn language_server_workspace_configuration(
|
||||
&mut self,
|
||||
_language_server_id: &zed::LanguageServerId,
|
||||
worktree: &zed::Worktree,
|
||||
) -> Result<Option<serde_json::Value>> {
|
||||
let settings = LspSettings::for_worktree("deno", worktree)
|
||||
.ok()
|
||||
.and_then(|lsp_settings| lsp_settings.settings.clone())
|
||||
.unwrap_or_default();
|
||||
Ok(Some(settings))
|
||||
}
|
||||
|
||||
fn label_for_completion(
|
||||
&self,
|
||||
_language_server_id: &LanguageServerId,
|
||||
|
Loading…
Reference in New Issue
Block a user