mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Merge from master
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface IMergeRegion {
|
||||
decoratorContent: vscode.Range;
|
||||
}
|
||||
|
||||
export enum CommitType {
|
||||
export const enum CommitType {
|
||||
Current,
|
||||
Incoming,
|
||||
Both
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user