mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -21,6 +21,11 @@
|
||||
},
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"category": "%command.category%",
|
||||
"title": "%command.accept.all-current%",
|
||||
"command": "merge-conflict.accept.all-current"
|
||||
},
|
||||
{
|
||||
"category": "%command.category%",
|
||||
"title": "%command.accept.all-incoming%",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"command.category": "Merge Conflict",
|
||||
"command.accept.all-current": "Accept All Current",
|
||||
"command.accept.all-incoming": "Accept All Incoming",
|
||||
"command.accept.all-both": "Accept All Both",
|
||||
"command.accept.current": "Accept Current",
|
||||
|
||||
@@ -13,7 +13,7 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro
|
||||
private config: interfaces.IExtensionConfiguration;
|
||||
private tracker: interfaces.IDocumentMergeConflictTracker;
|
||||
|
||||
constructor(private context: vscode.ExtensionContext, trackerService: interfaces.IDocumentMergeConflictTrackerService) {
|
||||
constructor(trackerService: interfaces.IDocumentMergeConflictTrackerService) {
|
||||
this.tracker = trackerService.createTracker('codelens');
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro
|
||||
}
|
||||
}
|
||||
|
||||
async provideCodeLenses(document: vscode.TextDocument, token: vscode.CancellationToken): Promise<vscode.CodeLens[] | null> {
|
||||
async provideCodeLenses(document: vscode.TextDocument, _token: vscode.CancellationToken): Promise<vscode.CodeLens[] | null> {
|
||||
|
||||
if (!this.config || !this.config.enableCodeLens) {
|
||||
return null;
|
||||
|
||||
@@ -24,7 +24,7 @@ export default class CommandHandler implements vscode.Disposable {
|
||||
private disposables: vscode.Disposable[] = [];
|
||||
private tracker: interfaces.IDocumentMergeConflictTracker;
|
||||
|
||||
constructor(private context: vscode.ExtensionContext, trackerService: interfaces.IDocumentMergeConflictTrackerService) {
|
||||
constructor(trackerService: interfaces.IDocumentMergeConflictTrackerService) {
|
||||
this.tracker = trackerService.createTracker('commands');
|
||||
}
|
||||
|
||||
@@ -43,38 +43,38 @@ export default class CommandHandler implements vscode.Disposable {
|
||||
);
|
||||
}
|
||||
|
||||
private registerTextEditorCommand(command: string, cb: (editor: vscode.TextEditor, ...args) => Promise<void>) {
|
||||
private registerTextEditorCommand(command: string, cb: (editor: vscode.TextEditor, ...args: any[]) => Promise<void>) {
|
||||
return vscode.commands.registerCommand(command, (...args) => {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
return editor && cb.call(this, editor, ...args);
|
||||
});
|
||||
}
|
||||
|
||||
acceptCurrent(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptCurrent(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
return this.accept(interfaces.CommitType.Current, editor, ...args);
|
||||
}
|
||||
|
||||
acceptIncoming(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptIncoming(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
return this.accept(interfaces.CommitType.Incoming, editor, ...args);
|
||||
}
|
||||
|
||||
acceptBoth(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptBoth(editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
return this.accept(interfaces.CommitType.Both, editor, ...args);
|
||||
}
|
||||
|
||||
acceptAllCurrent(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptAllCurrent(editor: vscode.TextEditor): Promise<void> {
|
||||
return this.acceptAll(interfaces.CommitType.Current, editor);
|
||||
}
|
||||
|
||||
acceptAllIncoming(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptAllIncoming(editor: vscode.TextEditor): Promise<void> {
|
||||
return this.acceptAll(interfaces.CommitType.Incoming, editor);
|
||||
}
|
||||
|
||||
acceptAllBoth(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
acceptAllBoth(editor: vscode.TextEditor): Promise<void> {
|
||||
return this.acceptAll(interfaces.CommitType.Both, editor);
|
||||
}
|
||||
|
||||
async compare(editor: vscode.TextEditor, conflict: interfaces.IDocumentMergeConflict | null, ...args) {
|
||||
async compare(editor: vscode.TextEditor, conflict: interfaces.IDocumentMergeConflict | null) {
|
||||
const fileName = path.basename(editor.document.uri.fsPath);
|
||||
|
||||
// No conflict, command executed from command palette
|
||||
@@ -102,15 +102,15 @@ export default class CommandHandler implements vscode.Disposable {
|
||||
vscode.commands.executeCommand('vscode.diff', leftUri, rightUri, title);
|
||||
}
|
||||
|
||||
navigateNext(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
navigateNext(editor: vscode.TextEditor): Promise<void> {
|
||||
return this.navigate(editor, NavigationDirection.Forwards);
|
||||
}
|
||||
|
||||
navigatePrevious(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
navigatePrevious(editor: vscode.TextEditor): Promise<void> {
|
||||
return this.navigate(editor, NavigationDirection.Backwards);
|
||||
}
|
||||
|
||||
async acceptSelection(editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
async acceptSelection(editor: vscode.TextEditor): Promise<void> {
|
||||
let conflict = await this.findConflictContainingSelection(editor);
|
||||
|
||||
if (!conflict) {
|
||||
@@ -175,7 +175,7 @@ export default class CommandHandler implements vscode.Disposable {
|
||||
editor.revealRange(navigationResult.conflict.range, vscode.TextEditorRevealType.Default);
|
||||
}
|
||||
|
||||
private async accept(type: interfaces.CommitType, editor: vscode.TextEditor, ...args): Promise<void> {
|
||||
private async accept(type: interfaces.CommitType, editor: vscode.TextEditor, ...args: any[]): Promise<void> {
|
||||
|
||||
let conflict: interfaces.IDocumentMergeConflict | null;
|
||||
|
||||
@@ -257,7 +257,7 @@ export default class CommandHandler implements vscode.Disposable {
|
||||
};
|
||||
}
|
||||
|
||||
let predicate: (conflict) => boolean;
|
||||
let predicate: (_conflict: any) => boolean;
|
||||
let fallback: () => interfaces.IDocumentMergeConflict;
|
||||
|
||||
if (direction === NavigationDirection.Forwards) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as interfaces from './interfaces';
|
||||
|
||||
export default class MergeConflictContentProvider implements vscode.TextDocumentContentProvider, vscode.Disposable {
|
||||
|
||||
@@ -13,7 +12,7 @@ export default class MergeConflictContentProvider implements vscode.TextDocument
|
||||
constructor(private context: vscode.ExtensionContext) {
|
||||
}
|
||||
|
||||
begin(config: interfaces.IExtensionConfiguration) {
|
||||
begin() {
|
||||
this.context.subscriptions.push(
|
||||
vscode.workspace.registerTextDocumentContentProvider(MergeConflictContentProvider.scheme, this)
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ export class Delayer<T> {
|
||||
public defaultDelay: number;
|
||||
private timeout: any; // Timer
|
||||
private completionPromise: Promise<T> | null;
|
||||
private onSuccess: ((value?: T | Thenable<T> | null) => void) | null;
|
||||
private onSuccess: ((value?: T | Thenable<T> | undefined) => void) | null;
|
||||
private task: ITask<T> | null;
|
||||
|
||||
constructor(defaultDelay: number) {
|
||||
@@ -45,7 +45,7 @@ export class Delayer<T> {
|
||||
if (delay >= 0 || this.timeout === null) {
|
||||
this.timeout = setTimeout(() => {
|
||||
this.timeout = null;
|
||||
this.onSuccess!(null);
|
||||
this.onSuccess!(undefined);
|
||||
}, delay >= 0 ? delay : this.defaultDelay);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ export class Delayer<T> {
|
||||
}
|
||||
this.cancelTimeout();
|
||||
let result = this.completionPromise;
|
||||
this.onSuccess!(null);
|
||||
this.onSuccess!(undefined);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict
|
||||
public commonAncestors: interfaces.IMergeRegion[];
|
||||
public splitter: vscode.Range;
|
||||
|
||||
constructor(document: vscode.TextDocument, descriptor: interfaces.IDocumentMergeConflictDescriptor) {
|
||||
constructor(descriptor: interfaces.IDocumentMergeConflictDescriptor) {
|
||||
this.range = descriptor.range;
|
||||
this.current = descriptor.current;
|
||||
this.incoming = descriptor.incoming;
|
||||
@@ -27,7 +27,7 @@ export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict
|
||||
|
||||
this.applyEdit(type, editor, edit);
|
||||
return Promise.resolve(true);
|
||||
};
|
||||
}
|
||||
|
||||
return editor.edit((edit) => this.applyEdit(type, editor, edit));
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ export default class DocumentMergeConflictTracker implements vscode.Disposable,
|
||||
this.cache.clear();
|
||||
}
|
||||
|
||||
private getConflictsOrEmpty(document: vscode.TextDocument, origins: string[]): interfaces.IDocumentMergeConflict[] {
|
||||
private getConflictsOrEmpty(document: vscode.TextDocument, _origins: string[]): interfaces.IDocumentMergeConflict[] {
|
||||
const containsConflict = MergeConflictParser.containsConflict(document);
|
||||
|
||||
if (!containsConflict) {
|
||||
|
||||
@@ -24,8 +24,8 @@ export interface IExtensionConfiguration {
|
||||
}
|
||||
|
||||
export interface IDocumentMergeConflict extends IDocumentMergeConflictDescriptor {
|
||||
commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit);
|
||||
applyEdit(type: CommitType, editor: vscode.TextEditor, edit: vscode.TextEditorEdit);
|
||||
commitEdit(type: CommitType, editor: vscode.TextEditor, edit?: vscode.TextEditorEdit): Thenable<boolean>;
|
||||
applyEdit(type: CommitType, editor: vscode.TextEditor, edit: vscode.TextEditorEdit): void;
|
||||
}
|
||||
|
||||
export interface IDocumentMergeConflictDescriptor {
|
||||
@@ -39,10 +39,10 @@ export interface IDocumentMergeConflictDescriptor {
|
||||
export interface IDocumentMergeConflictTracker {
|
||||
getConflicts(document: vscode.TextDocument): PromiseLike<IDocumentMergeConflict[]>;
|
||||
isPending(document: vscode.TextDocument): boolean;
|
||||
forget(document: vscode.TextDocument);
|
||||
forget(document: vscode.TextDocument): void;
|
||||
}
|
||||
|
||||
export interface IDocumentMergeConflictTrackerService {
|
||||
createTracker(origin: string): IDocumentMergeConflictTracker;
|
||||
forget(document: vscode.TextDocument);
|
||||
forget(document: vscode.TextDocument): void;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ export class MergeConflictParser {
|
||||
|
||||
return conflictDescriptors
|
||||
.filter(Boolean)
|
||||
.map(descriptor => new DocumentMergeConflict(document, descriptor));
|
||||
.map(descriptor => new DocumentMergeConflict(descriptor));
|
||||
}
|
||||
|
||||
private static scanItemTolMergeConflictDescriptor(document: vscode.TextDocument, scanned: IScanMergedConflict): interfaces.IDocumentMergeConflictDescriptor | null {
|
||||
|
||||
@@ -26,8 +26,8 @@ export default class ServiceWrapper implements vscode.Disposable {
|
||||
|
||||
this.services.push(
|
||||
documentTracker,
|
||||
new CommandHandler(this.context, documentTracker),
|
||||
new CodeLensProvider(this.context, documentTracker),
|
||||
new CommandHandler(documentTracker),
|
||||
new CodeLensProvider(documentTracker),
|
||||
new ContentProvider(this.context),
|
||||
new Decorator(this.context, documentTracker),
|
||||
);
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
],
|
||||
"module": "commonjs",
|
||||
"outDir": "./out",
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"strict": true,
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"include": [
|
||||
|
||||
26
extensions/merge-conflict/yarn.lock
Normal file
26
extensions/merge-conflict/yarn.lock
Normal file
@@ -0,0 +1,26 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/node@8.0.33":
|
||||
version "8.0.33"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd"
|
||||
|
||||
applicationinsights@0.18.0:
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
|
||||
|
||||
vscode-extension-telemetry@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
|
||||
dependencies:
|
||||
applicationinsights "0.18.0"
|
||||
winreg "1.2.3"
|
||||
|
||||
vscode-nls@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-2.0.2.tgz#808522380844b8ad153499af5c3b03921aea02da"
|
||||
|
||||
winreg@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
|
||||
Reference in New Issue
Block a user