Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/document.rs')
| -rw-r--r-- | helix-view/src/document.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index e52dbe0f..04b7703c 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -204,14 +204,11 @@ pub struct Document { pub readonly: bool, - pub previous_diagnostic_id: Option<String>, - /// Annotations for LSP document color swatches pub color_swatches: Option<DocumentColorSwatches>, // NOTE: ideally this would live on the handler for color swatches. This is blocked on a // large refactor that would make `&mut Editor` available on the `DocumentDidChange` event. pub color_swatch_controller: TaskController, - pub pull_diagnostic_controller: TaskController, // NOTE: this field should eventually go away - we should use the Editor's syn_loader instead // of storing a copy on every doc. Then we can remove the surrounding `Arc` and use the @@ -731,8 +728,6 @@ impl Document { color_swatches: None, color_swatch_controller: TaskController::new(), syn_loader, - previous_diagnostic_id: None, - pull_diagnostic_controller: TaskController::new(), } } @@ -980,7 +975,7 @@ impl Document { }; let identifier = self.path().map(|_| self.identifier()); - let language_servers: Vec<_> = self.language_servers.values().cloned().collect(); + let language_servers = self.language_servers.clone(); // mark changes up to now as saved let current_rev = self.get_current_revision(); @@ -1124,7 +1119,7 @@ impl Document { text: text.clone(), }; - for language_server in language_servers { + for (_, language_server) in language_servers { if !language_server.is_initialized() { continue; } @@ -1660,7 +1655,7 @@ impl Document { let savepoint_idx = self .savepoints .iter() - .position(|savepoint_ref| std::ptr::eq(savepoint_ref.as_ptr(), savepoint)) + .position(|savepoint_ref| savepoint_ref.as_ptr() == savepoint as *const _) .expect("Savepoint must belong to this document"); let savepoint_ref = self.savepoints.remove(savepoint_idx); @@ -2289,10 +2284,6 @@ impl Document { pub fn reset_all_inlay_hints(&mut self) { self.inlay_hints = Default::default(); } - - pub fn has_language_server_with_feature(&self, feature: LanguageServerFeature) -> bool { - self.language_servers_with_feature(feature).next().is_some() - } } #[derive(Debug, Default)] |