- if self.config.publish_diagnostics() {
- let snapshot = self.snapshot();
- self.task_pool.handle.spawn(move || {
- let diagnostics = subscriptions
- .into_iter()
- .filter_map(|file_id| {
- handlers::publish_diagnostics(&snapshot, file_id)
- .map_err(|err| {
- if !is_cancelled(&*err) {
- log::error!("failed to compute diagnostics: {:?}", err);
- }
- ()
- })
- .ok()
- .map(|diags| (file_id, diags))
- })
- .collect::<Vec<_>>();
- Task::Diagnostics(diagnostics)
- })
- }
+
+ let snapshot = self.snapshot();
+ self.task_pool.handle.spawn(move || {
+ let diagnostics = subscriptions
+ .into_iter()
+ .filter_map(|file_id| {
+ handlers::publish_diagnostics(&snapshot, file_id)
+ .map_err(|err| {
+ if !is_cancelled(&*err) {
+ log::error!("failed to compute diagnostics: {:?}", err);
+ }
+ ()
+ })
+ .ok()
+ .map(|diags| (file_id, diags))
+ })
+ .collect::<Vec<_>>();
+ Task::Diagnostics(diagnostics)
+ })