-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Add better merge extension #27150
Add better merge extension #27150
Conversation
- 'better-merge' command and setting namespace replaced with 'merge-conflict' - Configuration settings from extension replaced with single 'merge-conflicts.enabled' : boolean setting
Prior implementation in mergeConflictParserLegcacy which does a one shot regular expression.
@pprice, thanks for your PR! By analyzing the history of the files in this pull request, we identified @joaomoreno and @dbaeumer to be potential reviewers. |
@pprice, |
|
||
const rightTitle = `Incoming changes`; // (Ln${range.start.line}${!range.isSingleLine ? `-${range.end.line}` : ''})`; | ||
|
||
const title = `${fileName}: ${leftTitle} \u2194 ${rightTitle}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe inline the two titles and use a placeholder {0}
to localize like: https://github.com/Microsoft/vscode/blame/master/extensions/git/src/commands.ts#L754
} | ||
], | ||
"configuration": { | ||
"title": "Merge Conflict", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract to nls file for completeness.
} | ||
|
||
private getConflictsOrEmpty(document: vscode.TextDocument): interfaces.IDocumentMergeConflict[] { | ||
let stepStart = process.hrtime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skip or remove console output.
"description": "Merge Conflict", | ||
"version": "0.7.0", | ||
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", | ||
"enableProposedApi": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, I believe. Remove the property to clarify.
*--------------------------------------------------------------------------------------------*/ | ||
|
||
/// <reference path='../../../../src/vs/vscode.d.ts'/> | ||
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, I believe. Remove to clarify.
It is possible in the open / activate event cycle that we end up doing a double push of decorator changes to the editor, as both events pending on to the same delayed operation.
Just noticed this feature during a merge conflict. This is just great. Thanks a bunch!!! |
Adds the better merge extension to vscode proper. (https://marketplace.visualstudio.com/items?itemName=pprice.better-merge). This will enable decoration, code-lenses and commands for "standard" style merge conflicts.
Notable changes:
better-merge.*
command contributions changed tomerge-conflict.*
with same keybindings and functionality.merge-conflict.codeLens.enabled
andmerge-conflict.decorators.enabled
package.nls.json
andvcode-nls
usage) supportgit
extension decoration of merge blocks.Known TODOs:
mergeDecorator.ts
, when a document is opened then active. The actual scan happens once as it is debounced via the delayer, BUT the merge decorators are sent to the document twice. I have a candidate fix in the works.Potential TODOs (probably future PRs)