Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Diff contains a lot of garbage #41

Open
ColonelPhantom opened this issue Feb 11, 2022 · 2 comments
Open

Diff contains a lot of garbage #41

ColonelPhantom opened this issue Feb 11, 2022 · 2 comments

Comments

@ColonelPhantom
Copy link

Thank you for this plugin, I generally like it very much! I did however run into an issue with the built-in diff capability. I created an Asciinema recording to demonstrate: https://asciinema.org/a/TuSubUEB3xRAZUPmoBFoggqtW

As you can see, the diff for "replace match with if let" is huge, even though it just replaces 4 lines by 3 others.

The language server used is rust_analyzer.

@AbheetChaudhary
Copy link

Happening with me as well. Diffs are probably the best feature of this plugin. But it sometimes shows a lot of garbage, mainly repeatedly showing the same changes. It also shows wrong line numbers in diff(off by one). I have noticed this issue in rust_analyzer and sumneko_lua. Here's an example with rust_analyser:

fn main() {
    let x = 15;
}

In this function calling CodeActionMenu on any of let, x and 15 shows some possible code actions. On x and 15 its working fine. But on let only one of the two possible code actions is telling diff properly.
Here's what the second diff shows. It is repeating the difference. The line numbers are also wrong. Though I have noticed that the line numbers are consistently wrong everywhere. Is this some king of convention which I dont know of?

Similar issues arise with sumneko_lua and probably other LSP's as well

@algmyr
Copy link

algmyr commented Mar 10, 2023

Some quick debug printing shows that rust-analyzer issues a lot of edits, many of which are on the same lines. And this plugin does not deal with this properly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants