Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3c7b671

Browse files
committed
fix: Fix inverted code lens resolve file version check
1 parent 2c251a7 commit 3c7b671

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crates/rust-analyzer/src/from_proto.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ pub(crate) fn annotation(
105105

106106
match resolve.kind {
107107
lsp_ext::CodeLensResolveDataKind::Impls(params) => {
108-
if matches!(snap.url_file_version(&params.text_document_position_params.text_document.uri), Some(version) if version == resolve.version)
108+
if snap.url_file_version(&params.text_document_position_params.text_document.uri)
109+
!= Some(resolve.version)
109110
{
110111
return Ok(None);
111112
}
@@ -119,8 +120,7 @@ pub(crate) fn annotation(
119120
})
120121
}
121122
lsp_ext::CodeLensResolveDataKind::References(params) => {
122-
if matches!(snap.url_file_version(&params.text_document.uri), Some(version) if version == resolve.version)
123-
{
123+
if snap.url_file_version(&params.text_document.uri) != Some(resolve.version) {
124124
return Ok(None);
125125
}
126126
let pos @ FilePosition { file_id, .. } = file_position(snap, params)?;
@@ -131,5 +131,6 @@ pub(crate) fn annotation(
131131
kind: AnnotationKind::HasReferences { pos, data: None },
132132
})
133133
}
134-
}.map(Some)
134+
}
135+
.map(Some)
135136
}

0 commit comments

Comments
 (0)