Send a CodeLensRefresh when we reload

This commit is contained in:
kjeremy 2020-12-09 14:36:47 -05:00
parent 928d4c6744
commit 78dd2ba196
2 changed files with 13 additions and 0 deletions

View file

@ -198,6 +198,7 @@ pub struct Config {
pub lens: LensConfig,
pub hover: HoverConfig,
pub semantic_tokens_refresh: bool,
pub code_lens_refresh: bool,
pub linked_projects: Vec<LinkedProject>,
pub root_path: AbsPathBuf,
@ -340,6 +341,7 @@ impl Config {
lens: LensConfig::default(),
hover: HoverConfig::default(),
semantic_tokens_refresh: false,
code_lens_refresh: false,
linked_projects: Vec::new(),
root_path,
};
@ -581,6 +583,12 @@ impl Config {
{
self.semantic_tokens_refresh = refresh_support;
}
if let Some(refresh_support) =
workspace_caps.code_lens.as_ref().and_then(|it| it.refresh_support)
{
self.code_lens_refresh = refresh_support;
}
}
}

View file

@ -369,6 +369,11 @@ impl GlobalState {
self.semantic_tokens_cache.lock().clear();
self.send_request::<lsp_types::request::SemanticTokensRefesh>((), |_, _| ());
}
// Refresh code lens if the client supports it.
if self.config.code_lens_refresh {
self.send_request::<lsp_types::request::CodeLensRefresh>((), |_, _| ());
}
}
if let Some(diagnostic_changes) = self.diagnostics.take_changes() {