-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: handle merge conflicts #7127
Comments
I think it's not on rust-analyzer side, this is a common issue for all languages, vscode can have a |
What do other IDEs do? |
Would be kinda cool though. |
The cheapest thing to do would be to use the first block and skip the second block. That's probably a lot cheaper to implement and would make all the difference. (maybe have a setting to say always take the first or the second conflict chunk?) |
Note that rustc detects merge conflicts nicely now. Looks like this:
|
I agree we should detect this to some degree at least, rustc PR that introduced this for inspiration: rust-lang/rust#106242 |
One feature related to handling merge conflicts that would save me a lot of headaches would be to resolve a merge conflict in imports by merging the respective imports. For example, this is a very common conflict, where one commit added
In this case, an assist to merge these would be awesome. |
@Jesse-Bakker Technically, this can be achieved by accepting both and configuring rustfmt import granularity. Though I agree an assist would be nice. |
A regular source of annoyance for me is the flurry of error messages when I am resolving a merge conflict. There are syntax errors everywhere which make the code hard to read. Could rust-analyzer notice merge conflicts and refrain from emitting too many syntax errors? Maybe just a single error "syntax error: this is a merge conflict".
More far-fetched would be if ra could actually process both versions in parallel (or all 3 of them in 3-way merges), but I won't hold my breath x)
The text was updated successfully, but these errors were encountered: