Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -158,6 +158,11 @@ export default class CommandHandler implements vscode.Disposable {
let navigationResult = await this.findConflictForNavigation(editor, direction);
if (!navigationResult) {
// Check for autoNavigateNextConflict, if it's enabled(which indicating no conflict remain), then do not show warning
const mergeConflictConfig = vscode.workspace.getConfiguration('merge-conflict');
if (mergeConflictConfig.get<boolean>('autoNavigateNextConflict.enabled')) {
return;
}
vscode.window.showWarningMessage(localize('noConflicts', 'No merge conflicts found in this file'));
return;
}
@@ -196,6 +201,13 @@ export default class CommandHandler implements vscode.Disposable {
// Tracker can forget as we know we are going to do an edit
this.tracker.forget(editor.document);
conflict.commitEdit(type, editor);
// navigate to the next merge conflict
const mergeConflictConfig = vscode.workspace.getConfiguration('merge-conflict');
if (mergeConflictConfig.get<boolean>('autoNavigateNextConflict.enabled')) {
this.navigateNext(editor);
}
}
private async acceptAll(type: interfaces.CommitType, editor: vscode.TextEditor): Promise<void> {

View File

@@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as vscode from 'vscode';
export default class MergeConflictContentProvider implements vscode.TextDocumentContentProvider, vscode.Disposable {

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export interface ITask<T> {
(): T;

View File

@@ -11,7 +11,7 @@ export interface IMergeRegion {
decoratorContent: vscode.Range;
}
export enum CommitType {
export const enum CommitType {
Current,
Incoming,
Both

View File

@@ -188,9 +188,9 @@ export default class MergeDecorator implements vscode.Disposable {
// Store decorations keyed by the type of decoration, set decoration wants a "style"
// to go with it, which will match this key (see constructor);
let matchDecorations: { [key: string]: vscode.DecorationOptions[] } = {};
let matchDecorations: { [key: string]: vscode.Range[] } = {};
let pushDecoration = (key: string, d: vscode.DecorationOptions) => {
let pushDecoration = (key: string, d: vscode.Range) => {
matchDecorations[key] = matchDecorations[key] || [];
matchDecorations[key].push(d);
};
@@ -198,25 +198,25 @@ export default class MergeDecorator implements vscode.Disposable {
conflicts.forEach(conflict => {
// TODO, this could be more effective, just call getMatchPositions once with a map of decoration to position
if (!conflict.current.decoratorContent.isEmpty) {
pushDecoration('current.content', { range: conflict.current.decoratorContent });
pushDecoration('current.content', conflict.current.decoratorContent);
}
if (!conflict.incoming.decoratorContent.isEmpty) {
pushDecoration('incoming.content', { range: conflict.incoming.decoratorContent });
pushDecoration('incoming.content', conflict.incoming.decoratorContent);
}
conflict.commonAncestors.forEach(commonAncestorsRegion => {
if (!commonAncestorsRegion.decoratorContent.isEmpty) {
pushDecoration('commonAncestors.content', { range: commonAncestorsRegion.decoratorContent });
pushDecoration('commonAncestors.content', commonAncestorsRegion.decoratorContent);
}
});
if (this.config!.enableDecorations) {
pushDecoration('current.header', { range: conflict.current.header });
pushDecoration('splitter', { range: conflict.splitter });
pushDecoration('incoming.header', { range: conflict.incoming.header });
pushDecoration('current.header', conflict.current.header);
pushDecoration('splitter', conflict.splitter);
pushDecoration('incoming.header', conflict.incoming.header);
conflict.commonAncestors.forEach(commonAncestorsRegion => {
pushDecoration('commonAncestors.header', { range: commonAncestorsRegion.header });
pushDecoration('commonAncestors.header', commonAncestorsRegion.header);
});
}
});