pub call_info_full: bool,
pub lens: LensConfig,
pub hover: HoverConfig,
+ pub semantic_tokens_refresh: bool,
pub with_sysroot: bool,
pub linked_projects: Vec<LinkedProject>,
call_info_full: true,
lens: LensConfig::default(),
hover: HoverConfig::default(),
+ semantic_tokens_refresh: false,
linked_projects: Vec::new(),
root_path,
}
self.client_caps.hover_actions = get_bool("hoverActions");
self.client_caps.status_notification = get_bool("statusNotification");
}
+
+ if let Some(workspace_caps) = caps.workspace.as_ref() {
+ if let Some(refresh_support) =
+ workspace_caps.semantic_tokens.as_ref().and_then(|it| it.refresh_support)
+ {
+ self.semantic_tokens_refresh = refresh_support;
+ }
+ }
}
}
.collect::<Vec<_>>();
self.update_file_notifications_on_threadpool(subscriptions);
+
+ // Refresh semantic tokens if the client supports it.
+ if self.config.semantic_tokens_refresh {
+ self.semantic_tokens_cache.lock().clear();
+ self.send_request::<lsp_types::request::SemanticTokensRefesh>((), |_, _| ());
+ }
}
if let Some(diagnostic_changes) = self.diagnostics.take_changes() {