microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.61k stars 28.66k forks source link

3-Way Merge Editor & Older Merge Editor Stopped Showing Accept Changes #179797

Closed bryanjnelson closed 1 year ago

bryanjnelson commented 1 year ago

Type: Bug

Recently (perhaps after an update to the latest 1.77.2 patch?) VSCode has stopped showing the dialog in the 3WM Editor for "Accept Incoming | Accept Combination | Ignore". Furthermore, the older merge editor has also stopped showing the blue/green shading along with the "Accept Current Change | Accept Incoming Change.." dialog as well.

VS Code version: Code 1.77.2 (Universal) (e344f1f539a80912a0e9357cec841f36ce97a4e2, 2023-04-06T10:12:31.126Z) OS version: Darwin x64 22.3.0 Modes: Sandboxed: No

I have tried a rolling back to 1.76.x, but the behavior persists. I also have tried enabling/disabling the following toggles in Settings (along with their JSON counterparts manually):

Git: MergeEditor Merge-conflict > Code Lens: Enabled Merge-conflict > Decorators: Enabled

...but to no avail.

Merging_—_-zsh_—_236×58

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|5, 7, 7| |Memory (System)|16.00GB (0.04GB free)| |Process Argv|--crash-reporter-id 88ddcb61-7f2a-4aa0-9cf6-a88dcf704d24| |Screen Reader|no| |VM|0%|
Extensions (28) Extension|Author (truncated)|Version ---|---|--- project-manager|ale|12.7.0 classdiagram-ts|Ale|0.1.67 jest-snippets|and|1.9.1 vscode-zipfs|arc|3.0.0 npm-intellisense|chr|1.4.4 vscode-eslint|dba|2.4.0 prettier-vscode|esb|9.10.4 vscode-pull-request-github|Git|0.62.0 gc-excelviewer|Gra|4.2.57 vscode-graphql|Gra|0.8.7 vscode-graphql-execution|Gra|0.1.8 vscode-graphql-syntax|Gra|1.1.0 rest-client|hum|0.25.1 vscode-peacock|joh|4.2.2 start-git-bash|McC|1.2.1 vscode-language-babel|mgm|0.0.38 git-graph|mhu|1.30.0 dotenv|mik|1.0.1 vscode-docker|ms-|1.24.0 isort|ms-|2022.8.0 python|ms-|2023.6.0 deepdark-material|Nim|3.3.0 vscode-jest|Ort|5.2.3 vscode-versionlens|pfl|1.5.0 typescript-hero|rbb|3.0.0 vscode-icons|vsc|12.3.0 material-theme|zhu|3.15.8 vscode-open-in-github|ziy|1.3.6 (14 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 vscccc:30610679 nodejswelcome1:30587005 3biah626:30602489 pyind779:30671433 89544117:30613380 pythonsymbol12:30671437 vsccsb:30705552 vscodedisable:30660115 defaultazurewalk:30687958 pythonms35:30701012 pythonfmttextcf:30710682 ```
bryanjnelson commented 1 year ago

Upgraded to 1.77.3 but the behavior persists.

hediet commented 1 year ago

For some reason, the merge editor thinks this conflict has been resolved already (see "Manual Resolution", you can click on "Reset to base" to start over).

Can you reproduce this in a conflict you can share with us?

bryanjnelson commented 1 year ago

When you say share the conflict, in what manner do you mean exactly?

Thanks for your help.

hediet commented 1 year ago

There is a command to share the conflict as JSON, including base, theirs, yours and your current result.

bryanjnelson commented 1 year ago

Okay, good to know for the future. This seems to have been an isolated incident and I am no longer able to easily reproduce it, if it all. If it happens again I will include that information on a subsequent issue. Thank you for your help.

justingrant commented 1 year ago

I have a repro. I'm not sure if the old version had the same problem, but given that I've done hundreds of rebases in the last year and never ran into it, I'm inclined to think that it's a new problem. Repro steps:

  1. Open a file in the source control (side-by-side diff) view.
  2. Make some changes in the file and commit them. Leave the side-by-side diff view open.
  3. In integrated terminal, git rebase somebranch where somebranch has a merge conflict to your working tree in the file you were just editing in (1)

Expected:

image

Actual:

image

My guess of the cause of the problem is that the IDE was already showing the diff view and didn't realize that it needed to start showing Accept Changes links in that view after the rebase added the merge conflict markers. I'd have assumed that VS Code should be smart enough to show those links whenever it detects a merge conflict marker, regardless of how it got there, and regardless of whether I'm already editing the file or not, regardless of whether I'm currently looking at a side-by-side diff view or the regular file, etc.

Once I clicked on the file in the Merge Conflicts section of the left pane, then I saw the Accept Changes links as normal. (that's how I captured the Expected screenshot above.) The side-by-side diff view still didn't have them, though. The two tabs were coexisting side-by-side in the IDE.

To see if closing and re-opening the side-by-side diff view would fix the problem, I closed the "Actual" tab but I couldn't figure out how to get the side-by-side view to open again. So I couldn't test whether closing and re-opening that view would cause the problem to repro again.

hediet commented 1 year ago

@justingrant thanks for reporting this! However, this is not the 3 way merge editor this issue is about. Feel free to create a new issues.