Symbolk / somanyconflicts

No more headache on So Many Conflicts after merging!
https://marketplace.visualstudio.com/items?itemName=symbolk.somanyconflicts
MIT License
7 stars 3 forks source link
logo

So Many Conflicts

A VSCode extension to help developers resolve so many merge conflicts interactively and systematically, to lighten this tedious work and avoid making mistakes.

screen

Features

Language Support

Requirements

Installation

Quick Start

  1. Open a Git repository with unresolved merge conflicts in VSCode.
  2. Click the button in the side bar, or invoke by command starting with somany.
  3. Start resolving by starting from the grouped and ordered related conflicts.
  4. Navigate and jump to related conflict blocks to resolve by the way.
  5. After all conflicts resolved, go on committing the changes.

Develop

Requirements

Under macOS/Linux (Recommended)

Instructions

Under macOS (Recommended)

  1. Install XCode command line tools:
    xcode-select --install
  2. Clone repo and open in VSCode.
  3. Open the terminal, install Emscripten (the compiler toolchain to WebAssembly): https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install
  4. In the same terminal and under the project root, run yarn or npm i to download dependencies.
  5. Press F5 to run and debug extension.
  6. In the new window, press F1 or Cmd+Shift+P and invoke command somany.

Trick: When debugging, install the extension Auto Run Command and configure it in Code-Preferences-Settings, you can avoid manually invoke the command:

  "auto-run-command.rules": [
    {
      "condition": "isRootFolder: XXX",
      "command": "somanyconflicts.start",
      "message": "Running So Many Conflicts"
    }
  ],

Under Windows

  1. Install windows-build-tools:

    npm install --global windows-build-tools
  2. Clone repo and open in VSCode.

  3. Open the terminal, install Emscripten (the compiler toolchain to WebAssembly): https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install

  4. In the same terminal and under the project root, run yarn or npm i to download dependencies.

  5. Press F5 to run and debug extension.

  6. In the new window, press F1 or Ctrl+Shift+P and invoke command somany.

Known Issues

  1. If you find that electron takes too much time to install when running yarn, stop it with Command+C and remove "electron": "13.1.7" from package.json first, then run the following command to install modules:
yarn
ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/ yarn add -D electron@13.1.7
  1. [Deprecated] Treesitter is a native module that must be rebuilt locally after installed to match the electron node version of VSCode (see electron-rebuild). However, directly running rebuild will result in an error about C++ version. There is an unmerged PR and a related issue for node-tree-sitter, for now you need to follow these steps to successfully rebuild it:
     'xcode_settings': {
-       'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
+       'CLANG_CXX_LANGUAGE_STANDARD': 'c++14',
     },
./node_modules/.bin/electron-rebuild

Note that, unfortunately, each time you run yarn, you need to rebuild treesitter as above :-(

Conflicts parsing part is borrowed from Conflict Squeezer, thanks for the nice work!