1use vs_shell::{global_current_dir, project_sdk_dir, remove_existing};
4
5use crate::{App, CoreError, UseScope};
6
7impl App {
8 pub fn unuse_tool(&self, plugin_name: &str, scope: UseScope) -> Result<(), CoreError> {
10 match scope {
11 UseScope::Global => {
12 self.write_tool_assignment(
13 &vs_config::global_tools_file(self.home()),
14 plugin_name,
15 None,
16 )?;
17 remove_existing(&global_current_dir(self.home(), plugin_name))?;
18 }
19 UseScope::Project => {
20 self.write_tool_assignment(&self.preferred_project_file(), plugin_name, None)?;
21 remove_existing(&project_sdk_dir(&self.cwd, plugin_name))?;
22 }
23 UseScope::Session => {
24 let session_file = self.session_file()?;
25 self.write_tool_assignment(&session_file, plugin_name, None)?;
26 }
27 }
28 Ok(())
29 }
30}