diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-04-09 11:27:27 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 11:27:27 +1000 |
commit | d9d4a5d73c28741deaa2c93d87672ce117315fbf (patch) | |
tree | 57d08deb2e80796f9e426a4592b47254b112021d /cli/lsp/config.rs | |
parent | 3168fa4ee7782e72b57745483a7b0df5df5ce083 (diff) |
feat(lsp): add registry import auto-complete (#9934)
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r-- | cli/lsp/config.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index 99603f170..63f04e3cf 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -7,6 +7,7 @@ use deno_core::url::Url; use lspower::jsonrpc::Error as LSPError; use lspower::jsonrpc::Result as LSPResult; use lspower::lsp; +use std::collections::HashMap; #[derive(Debug, Clone, Default)] pub struct ClientCapabilities { @@ -52,6 +53,8 @@ pub struct CompletionSettings { pub paths: bool, #[serde(default)] pub auto_imports: bool, + #[serde(default)] + pub imports: ImportCompletionSettings, } impl Default for CompletionSettings { @@ -61,6 +64,22 @@ impl Default for CompletionSettings { names: true, paths: true, auto_imports: true, + imports: ImportCompletionSettings::default(), + } + } +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ImportCompletionSettings { + #[serde(default)] + pub hosts: HashMap<String, bool>, +} + +impl Default for ImportCompletionSettings { + fn default() -> Self { + Self { + hosts: HashMap::default(), } } } |