diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-09-21 06:46:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-21 06:46:39 +0100 |
commit | a4ac6a3f5f1b02b5290ab603d76b5cd9030731ca (patch) | |
tree | 6abbd056b42355f818383393cebe571072e0253b /cli/lsp/repl.rs | |
parent | 0981aefbdce4c0be961f6447bf68069c518227ef (diff) |
refactor(lsp): store language sections in WorkspaceSettings (#20593)
When sending configuration requests to the client, reads `javascript`
and `typescript` sections in addition to `deno`.
The LSP's initialization options now accepts `javascript` and
`typescript` namespaces.
Diffstat (limited to 'cli/lsp/repl.rs')
-rw-r--r-- | cli/lsp/repl.rs | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/cli/lsp/repl.rs b/cli/lsp/repl.rs index c09a142d6..5e1bb66de 100644 --- a/cli/lsp/repl.rs +++ b/cli/lsp/repl.rs @@ -33,7 +33,9 @@ use tower_lsp::LanguageServer; use super::client::Client; use super::config::CompletionSettings; +use super::config::DenoCompletionSettings; use super::config::ImportCompletionSettings; +use super::config::LanguageWorkspaceSettings; use super::config::TestingSettings; use super::config::WorkspaceSettings; @@ -292,23 +294,36 @@ pub fn get_repl_workspace_settings() -> WorkspaceSettings { cache: None, import_map: None, code_lens: Default::default(), - inlay_hints: Default::default(), internal_debug: false, lint: false, document_preload_limit: 0, // don't pre-load any modules as it's expensive and not useful for the repl tls_certificate: None, unsafely_ignore_certificate_errors: None, unstable: false, - suggest: CompletionSettings { - complete_function_calls: false, - names: false, - paths: false, - auto_imports: false, + suggest: DenoCompletionSettings { imports: ImportCompletionSettings { auto_discover: false, hosts: HashMap::from([("https://deno.land".to_string(), true)]), }, }, testing: TestingSettings { args: vec![] }, + javascript: LanguageWorkspaceSettings { + inlay_hints: Default::default(), + suggest: CompletionSettings { + complete_function_calls: false, + names: false, + paths: false, + auto_imports: false, + }, + }, + typescript: LanguageWorkspaceSettings { + inlay_hints: Default::default(), + suggest: CompletionSettings { + complete_function_calls: false, + names: false, + paths: false, + auto_imports: false, + }, + }, } } |