rust-lang / rust-analyzer

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

Fix source_range for INT_NUMBER in completion #17192

Closed roife closed 1 week ago

roife commented 1 week ago

fix #17179.

Previously r-a use TextRange::empty(self.position.offset) as source_range for INT_NUMBER, so the text_edit would always be an insertion, which results in #17179.

This PR changed it by using text_range of original_token (same as IDENT).

lnicola commented 1 week ago

Thanks!

@bors r+

bors commented 1 week ago

:pushpin: Commit 435e83d9ad505770062c806af85a1df35b138b59 has been approved by lnicola

It is now in the queue for this repository.

bors commented 1 week ago

:hourglass: Testing commit 435e83d9ad505770062c806af85a1df35b138b59 with merge 9ec04ed43de2476fc40408021d3a2ece5773e31a...

bors commented 1 week ago

:sunny: Test successful - checks-actions Approved by: lnicola Pushing 9ec04ed43de2476fc40408021d3a2ece5773e31a to master...