diff options
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r-- | cli/lsp/config.rs | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index 74f3583d6..07fdd3c65 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -50,8 +50,6 @@ use std::sync::Arc; use tower_lsp::lsp_types as lsp; use super::logging::lsp_log; -use super::lsp_custom; -use super::urls::url_to_uri; use crate::args::discover_npmrc_from_workspace; use crate::args::has_flag_env_var; use crate::args::CliLockfile; @@ -1718,14 +1716,14 @@ impl ConfigTree { .unwrap_or_else(|| Arc::new(FmtConfig::new_with_base(PathBuf::from("/")))) } - /// Returns (scope_url, type). + /// Returns (scope_uri, type). pub fn watched_file_type( &self, specifier: &ModuleSpecifier, ) -> Option<(&ModuleSpecifier, ConfigWatchedFileType)> { - for (scope_url, data) in self.scopes.iter() { + for (scope_uri, data) in self.scopes.iter() { if let Some(typ) = data.watched_files.get(specifier) { - return Some((scope_url, *typ)); + return Some((scope_uri, *typ)); } } None @@ -1749,46 +1747,6 @@ impl ConfigTree { .any(|data| data.watched_files.contains_key(specifier)) } - pub fn to_did_refresh_params( - &self, - ) -> lsp_custom::DidRefreshDenoConfigurationTreeNotificationParams { - let data = self - .scopes - .values() - .filter_map(|data| { - let workspace_root_scope_uri = - Some(data.member_dir.workspace.root_dir()) - .filter(|s| *s != data.member_dir.dir_url()) - .and_then(|s| url_to_uri(s).ok()); - Some(lsp_custom::DenoConfigurationData { - scope_uri: url_to_uri(&data.scope).ok()?, - deno_json: data.maybe_deno_json().and_then(|c| { - if workspace_root_scope_uri.is_some() - && Some(&c.specifier) - == data - .member_dir - .workspace - .root_deno_json() - .map(|c| &c.specifier) - { - return None; - } - Some(lsp::TextDocumentIdentifier { - uri: url_to_uri(&c.specifier).ok()?, - }) - }), - package_json: data.maybe_pkg_json().and_then(|p| { - Some(lsp::TextDocumentIdentifier { - uri: url_to_uri(&p.specifier()).ok()?, - }) - }), - workspace_root_scope_uri, - }) - }) - .collect(); - lsp_custom::DidRefreshDenoConfigurationTreeNotificationParams { data } - } - pub async fn refresh( &mut self, settings: &Settings, |