mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-02-13 20:48:33 +00:00
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
This commit is contained in:
commit
10e0aaf284
1 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue