mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Merge #6790
6790: Send a CodeLensRefresh when we reload r=kjeremy a=kjeremy Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
commit
06a03bab8e
2 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue