diff options
| author | bors <bors@rust-lang.org> | 2023-04-14 06:42:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-14 06:42:45 +0000 |
| commit | 10e0aaf28434113ebcf75cd8249e1439bb63a7fe (patch) | |
| tree | 401a7206a6f4192764bc38cc2a6ad250407c34c1 | |
| parent | 2c251a7e2bdd44120f900063bc1809c1475a7372 (diff) | |
| parent | 3c7b6716d1ab458664a8b372b79347b9a9cacb98 (diff) | |
| download | rust-10e0aaf28434113ebcf75cd8249e1439bb63a7fe.tar.gz rust-10e0aaf28434113ebcf75cd8249e1439bb63a7fe.zip | |
Auto merge of #14570 - Veykril:code-lens-fix, r=Veykril
fix: Fix inverted code lens resolve file version check Fixes https://github.com/rust-lang/rust-analyzer/issues/14568
| -rw-r--r-- | crates/rust-analyzer/src/from_proto.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/rust-analyzer/src/from_proto.rs b/crates/rust-analyzer/src/from_proto.rs index 1482183926d..44891fad1a9 100644 --- a/crates/rust-analyzer/src/from_proto.rs +++ b/crates/rust-analyzer/src/from_proto.rs @@ -105,7 +105,8 @@ pub(crate) fn annotation( match resolve.kind { lsp_ext::CodeLensResolveDataKind::Impls(params) => { - if matches!(snap.url_file_version(¶ms.text_document_position_params.text_document.uri), Some(version) if version == resolve.version) + if snap.url_file_version(¶ms.text_document_position_params.text_document.uri) + != Some(resolve.version) { return Ok(None); } @@ -119,8 +120,7 @@ pub(crate) fn annotation( }) } lsp_ext::CodeLensResolveDataKind::References(params) => { - if matches!(snap.url_file_version(¶ms.text_document.uri), Some(version) if version == resolve.version) - { + if snap.url_file_version(¶ms.text_document.uri) != Some(resolve.version) { return Ok(None); } let pos @ FilePosition { file_id, .. } = file_position(snap, params)?; @@ -131,5 +131,6 @@ pub(crate) fn annotation( kind: AnnotationKind::HasReferences { pos, data: None }, }) } - }.map(Some) + } + .map(Some) } |
