mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 13:33:31 +00:00
Do not return code lens data after resolving
This commit is contained in:
parent
596e5c77cf
commit
ad5e2cfa3b
1 changed files with 5 additions and 1 deletions
|
@ -1319,6 +1319,9 @@ pub(crate) fn handle_code_lens_resolve(
|
||||||
snap: GlobalStateSnapshot,
|
snap: GlobalStateSnapshot,
|
||||||
code_lens: CodeLens,
|
code_lens: CodeLens,
|
||||||
) -> anyhow::Result<CodeLens> {
|
) -> anyhow::Result<CodeLens> {
|
||||||
|
if code_lens.data.is_none() {
|
||||||
|
return Ok(code_lens);
|
||||||
|
}
|
||||||
let Some(annotation) = from_proto::annotation(&snap, code_lens.clone())? else {
|
let Some(annotation) = from_proto::annotation(&snap, code_lens.clone())? else {
|
||||||
return Ok(code_lens);
|
return Ok(code_lens);
|
||||||
};
|
};
|
||||||
|
@ -1327,13 +1330,14 @@ pub(crate) fn handle_code_lens_resolve(
|
||||||
let mut acc = Vec::new();
|
let mut acc = Vec::new();
|
||||||
to_proto::code_lens(&mut acc, &snap, annotation)?;
|
to_proto::code_lens(&mut acc, &snap, annotation)?;
|
||||||
|
|
||||||
let res = match acc.pop() {
|
let mut res = match acc.pop() {
|
||||||
Some(it) if acc.is_empty() => it,
|
Some(it) if acc.is_empty() => it,
|
||||||
_ => {
|
_ => {
|
||||||
never!();
|
never!();
|
||||||
code_lens
|
code_lens
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
res.data = None;
|
||||||
|
|
||||||
Ok(res)
|
Ok(res)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue