show "Accept Merge" only for files currently under conflict. (#155822)

While the merge editor shows users can handle merge conflicts outside of it, e.g on the console via `git add <FILE>`. The merge editor should have this graceful and step one is to hide the "Accept Merge" command when the file isn't conflicting anymore

* Adds a git-context key that contains all resource-uri-strings under conflict
* Enable/placement of the Accept Merge command is driven by that
* some merge editor context key sugar
This commit is contained in:
Johannes Rieken
2022-07-21 13:25:23 +02:00
committed by GitHub
parent cef02dae8d
commit bbbae594da
5 changed files with 28 additions and 13 deletions

View File

@@ -601,7 +601,7 @@
"command": "git.acceptMerge",
"title": "%command.git.acceptMerge%",
"category": "Git",
"enablement": "isMergeEditor"
"enablement": "isMergeEditor && mergeEditorResultUri in git.mergeChanges"
}
],
"keybindings": [
@@ -1549,7 +1549,7 @@
"merge/toolbar": [
{
"command": "git.acceptMerge",
"when": "isMergeEditor && baseResourceScheme =~ /^git$|^file$/"
"when": "isMergeEditor && mergeEditorBaseUri =~ /^(git|file):/ && mergeEditorResultUri in git.mergeChanges"
}
],
"scm/change/title": [