Skip to content

Commit 4a23744

Browse files
committed
Auto merge of rust-lang#16435 - SomeoneToIgnore:less_resolve_data, r=lnicola
Do not return code lens data after resolving
2 parents 596e5c7 + ad5e2cf commit 4a23744

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/rust-analyzer/src/handlers/request.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,9 @@ pub(crate) fn handle_code_lens_resolve(
13191319
snap: GlobalStateSnapshot,
13201320
code_lens: CodeLens,
13211321
) -> anyhow::Result<CodeLens> {
1322+
if code_lens.data.is_none() {
1323+
return Ok(code_lens);
1324+
}
13221325
let Some(annotation) = from_proto::annotation(&snap, code_lens.clone())? else {
13231326
return Ok(code_lens);
13241327
};
@@ -1327,13 +1330,14 @@ pub(crate) fn handle_code_lens_resolve(
13271330
let mut acc = Vec::new();
13281331
to_proto::code_lens(&mut acc, &snap, annotation)?;
13291332

1330-
let res = match acc.pop() {
1333+
let mut res = match acc.pop() {
13311334
Some(it) if acc.is_empty() => it,
13321335
_ => {
13331336
never!();
13341337
code_lens
13351338
}
13361339
};
1340+
res.data = None;
13371341

13381342
Ok(res)
13391343
}

0 commit comments

Comments
 (0)