Hi. I'm new to RA development, so there is a question I can't find any answer to - how do I compare types by ExprIds? I'm currently trying to implement https://github.com/rust-analyzer/rust-analyzer/issues/6739 by checking for missing tail expression, and comparing last statement type with body type.
You need to look up its type in the
Thanks, it worked! Looks like I have some naive implementation, though it seems to be working demo.mp4
Can I get some code review please? https://github.com/ivan770/rust-analyzer/commit/cb66bb8ff9609d4fc3702ac1ed6197802b54e473
The code looks pretty good to me. If you submit a PR we can do a proper review.
@matklad Hi. Can you help me a bit with that part? https://github.com/rust-analyzer/rust-analyzer/pull/6769#discussion_r540146705
I can't find any way to obtain ExprStmt, as AstNode casts don't work here because of different kinds.
Hm, riiight, good question
We don't actually store info about statements in the source map yet
I guess that means that we should stick to an
Then, in the fix, where you care getting the
;, you can write
Thanks, it worked!