rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.31k stars 1.62k forks source link

fix: Fix related documents diagnostics #18519

Closed ChayimFriedman2 closed 5 days ago

ChayimFriedman2 commented 5 days ago

They were converted to LSP position using the current file's line index, which is obviously wrong.

I'm not sure how to test this since that require an entire operating r-a, since the functionality is in the rust-analyzer crate. I verified manually that this works.

The problem was introduced in #18404. Oopsie :)

Fixes #18513.

lnicola commented 5 days ago

Ouch, this might warrant another beta backport.

davidbarsky commented 4 days ago

I'm not sure how to test this since that require an entire operating r-a, since the functionality is in the rust-analyzer crate.

crates/rust-analyzer/slow-tests is a good spot to test protocol-level interactions like these!