Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lsp): send "deno/didChangeDenoConfiguration" notifications #20827

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comments, remove dead code
  • Loading branch information
nayeemrmn committed Oct 11, 2023
commit fc87ca386fed037b5e52f0012b5a5318517ad22c
7 changes: 7 additions & 0 deletions cli/lsp/language_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1518,17 +1518,24 @@ impl Inner {

// if the current deno.json has changed, we need to reload it
if has_config_changed(&self.config, &changes) {
// Check the 'current' config specifier from both before and after it's
// updated. Check canonicalized and uncanonicalized variants for each.
// If any are included in `changes`, send our custom notification for
// `deno.json` changes: `deno/didChangeDenoConfigurationNotification`.
let mut files_to_check = HashSet::with_capacity(4);
nayeemrmn marked this conversation as resolved.
Show resolved Hide resolved
// Collect previous config specifiers.
if let Some(url) = self.config.maybe_config_file().map(|c| &c.specifier) {
files_to_check.insert(url.clone());
}
if let Some(url) = self.config.maybe_config_file_canonicalized_specifier()
{
files_to_check.insert(url.clone());
}
// Update config.
if let Err(err) = self.update_config_file().await {
self.client.show_message(MessageType::WARNING, err);
}
// Collect new config specifiers.
if let Some(url) = self.config.maybe_config_file().map(|c| &c.specifier) {
files_to_check.insert(url.clone());
}
Expand Down
6 changes: 0 additions & 6 deletions test_util/src/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,6 @@ impl InitializeParamsBuilder {
self
}

pub fn unset_deno_enable(&mut self) -> &mut Self {
let options = self.initialization_options_mut();
options.insert("enable".to_string(), json!(null));
self
}

pub fn set_import_map(&mut self, value: impl AsRef<str>) -> &mut Self {
let options = self.initialization_options_mut();
options.insert("importMap".to_string(), value.as_ref().to_string().into());
Expand Down