mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
perf(lsp): store settings in Arc (#24191)
This commit is contained in:
parent
d89ff73f9c
commit
518e4d3b3a
3 changed files with 68 additions and 43 deletions
|
@ -1611,21 +1611,21 @@ mod tests {
|
|||
fn mock_config() -> Config {
|
||||
let root_uri = resolve_url("file:///").unwrap();
|
||||
Config {
|
||||
settings: Settings {
|
||||
unscoped: WorkspaceSettings {
|
||||
settings: Arc::new(Settings {
|
||||
unscoped: Arc::new(WorkspaceSettings {
|
||||
enable: Some(true),
|
||||
lint: true,
|
||||
..Default::default()
|
||||
},
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
workspace_folders: vec![(
|
||||
}),
|
||||
workspace_folders: Arc::new(vec![(
|
||||
root_uri.clone(),
|
||||
lsp::WorkspaceFolder {
|
||||
uri: root_uri,
|
||||
name: "".to_string(),
|
||||
},
|
||||
)],
|
||||
)]),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
@ -1719,10 +1719,13 @@ let c: number = "a";
|
|||
// now test disabled specifier
|
||||
{
|
||||
let mut disabled_config = mock_config();
|
||||
disabled_config.settings.unscoped = WorkspaceSettings {
|
||||
enable: Some(false),
|
||||
..Default::default()
|
||||
};
|
||||
disabled_config.set_workspace_settings(
|
||||
WorkspaceSettings {
|
||||
enable: Some(false),
|
||||
..Default::default()
|
||||
},
|
||||
vec![],
|
||||
);
|
||||
|
||||
let diagnostics = generate_lint_diagnostics(
|
||||
&snapshot,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue