1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

chore(lsp): remove enablePaths compat path (#22895)

This commit is contained in:
Nayeem Rahman 2024-03-13 20:22:02 +00:00 committed by GitHub
parent bbc211906d
commit eca7b0cddd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -786,31 +786,6 @@ impl Settings {
} }
(&self.unscoped, None) (&self.unscoped, None)
} }
pub fn set_unscoped(&mut self, mut settings: WorkspaceSettings) {
// See https://github.com/denoland/vscode_deno/issues/908.
if settings.enable_paths == Some(vec![]) {
settings.enable_paths = None;
}
self.unscoped = settings;
}
pub fn set_for_workspace_folders(
&mut self,
mut by_workspace_folder: Option<
BTreeMap<ModuleSpecifier, WorkspaceSettings>,
>,
) {
if let Some(by_workspace_folder) = &mut by_workspace_folder {
for settings in by_workspace_folder.values_mut() {
// See https://github.com/denoland/vscode_deno/issues/908.
if settings.enable_paths == Some(vec![]) {
settings.enable_paths = None;
}
}
}
self.by_workspace_folder = by_workspace_folder;
}
} }
#[derive(Debug)] #[derive(Debug)]
@ -871,8 +846,10 @@ impl Config {
unscoped: WorkspaceSettings, unscoped: WorkspaceSettings,
by_workspace_folder: Option<BTreeMap<ModuleSpecifier, WorkspaceSettings>>, by_workspace_folder: Option<BTreeMap<ModuleSpecifier, WorkspaceSettings>>,
) { ) {
self.settings.set_unscoped(unscoped); self.settings = Settings {
self.settings.set_for_workspace_folders(by_workspace_folder); unscoped,
by_workspace_folder,
};
} }
pub fn workspace_settings(&self) -> &WorkspaceSettings { pub fn workspace_settings(&self) -> &WorkspaceSettings {