mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
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.
This commit is contained in:
parent
0981aefbdc
commit
a4ac6a3f5f
7 changed files with 501 additions and 185 deletions
|
@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue