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:
@@ -1,2 +1,5 @@
|
||||
src/**
|
||||
tsconfig.json
|
||||
tsconfig.json
|
||||
out/**
|
||||
extension.webpack.config.js
|
||||
yarn.lock
|
||||
17
extensions/merge-conflict/extension.webpack.config.js
Normal file
17
extensions/merge-conflict/extension.webpack.config.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//@ts-check
|
||||
|
||||
'use strict';
|
||||
|
||||
const withDefaults = require('../shared.webpack.config');
|
||||
|
||||
module.exports = withDefaults({
|
||||
context: __dirname,
|
||||
entry: {
|
||||
extension: './src/extension.ts'
|
||||
}
|
||||
});
|
||||
@@ -79,10 +79,24 @@
|
||||
{
|
||||
"category": "%command.category%",
|
||||
"title": "%command.compare%",
|
||||
"original":"Compare Current Conflict",
|
||||
"original": "Compare Current Conflict",
|
||||
"command": "merge-conflict.compare"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"scm/resourceState/context": [
|
||||
{
|
||||
"command": "merge-conflict.accept.all-current",
|
||||
"when": "scmProvider == git && scmResourceGroup == merge",
|
||||
"group": "1_modification"
|
||||
},
|
||||
{
|
||||
"command": "merge-conflict.accept.all-incoming",
|
||||
"when": "scmProvider == git && scmResourceGroup == merge",
|
||||
"group": "1_modification"
|
||||
}
|
||||
]
|
||||
},
|
||||
"configuration": {
|
||||
"title": "%config.title%",
|
||||
"properties": {
|
||||
@@ -95,14 +109,19 @@
|
||||
"type": "boolean",
|
||||
"description": "%config.decoratorsEnabled%",
|
||||
"default": true
|
||||
},
|
||||
"merge-conflict.autoNavigateNextConflict.enabled": {
|
||||
"type": "boolean",
|
||||
"description": "%config.autoNavigateNextConflictEnabled%",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-nls": "^3.2.4"
|
||||
"vscode-nls": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "8.0.33"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"command.previous": "Previous Conflict",
|
||||
"command.compare": "Compare Current Conflict",
|
||||
"config.title": "Merge Conflict",
|
||||
"config.autoNavigateNextConflictEnabled": "Whether to automatically navigate to the next merge conflict after resolving a merge conflict.",
|
||||
"config.codeLensEnabled": "Create a Code Lens for merge conflict blocks within editor.",
|
||||
"config.decoratorsEnabled": "Create decorators for merge conflict blocks within editor."
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
{
|
||||
"extends": "../shared.tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es2016"
|
||||
],
|
||||
"module": "commonjs",
|
||||
"outDir": "./out",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"strict": true,
|
||||
"experimentalDecorators": true
|
||||
"outDir": "./out"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd"
|
||||
integrity sha512-vmCdO8Bm1ExT+FWfC9sd9r4jwqM7o97gGy2WBshkkXbf/2nLAJQUrZfIhw27yVOtLUev6kSZc4cav/46KbDd8A==
|
||||
|
||||
vscode-nls@^3.2.4:
|
||||
version "3.2.4"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.4.tgz#2166b4183c8aea884d20727f5449e62be69fd398"
|
||||
integrity sha512-FTjdqa4jDDoBjJqr36O8lmmZf/55kQ2w4ZY/+GL6K92fq765BqO3aYw21atnXUno/P04V5DWagNl4ybDIndJsw==
|
||||
vscode-nls@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-4.0.0.tgz#4001c8a6caba5cedb23a9c5ce1090395c0e44002"
|
||||
integrity sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==
|
||||
|
||||
Reference in New Issue
Block a user