ryuta46 / vscode-multi-command

Visual Studio Code Plugin named multi-command
MIT License
229 stars 14 forks source link

Make "multiCommand.commands" an object with commands as keys #30

Closed rioj7 closed 3 years ago

rioj7 commented 4 years ago

Currently the "multiCommand.commands" configuration is an array of objects. If you have this setting in the global settings.json and workspace settings.json they don't merge.

If I want to use a particular multiCommand.XYZ in all my workspaces I have to copy/paste the setting.

If the setting was an object the setting will be merged for global-multi_root_workspace-workspace. The command argument of the objects is now the key of the object in the parent object

  "multiCommand.commands": {
    "multiCommand.someName1": {
      "sequence": [
            "cursorLeftSelect",
            "editor.action.clipboardCutAction"
      ]
    },
    "multiCommand.someName2": {
      "sequence": [
            "editor.action.clipboardCutAction",
            "cursorLeftSelect"
      ]
    }
  }

In the extension it is easy:

ryuta46 commented 3 years ago

As you mentioned, "multiCommand.commands" is an array of object and doesn't merge user settings and workspace settings. In the next version, I'll change it to the format you suggested, while maintaining backwards compatibility.

ryuta46 commented 3 years ago

Implemented in 1.5.0. Please reopen this issue or create new issue if you have any problem about this feature. Thanks.