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:
Karl Burtram
2018-01-28 23:37:17 -08:00
committed by GitHub
parent 9a1ac20710
commit 251ae01c3e
8009 changed files with 93378 additions and 35634 deletions

View File

@@ -10,31 +10,24 @@ import URI from 'vs/base/common/uri';
import Event, { Emitter } from 'vs/base/common/event';
import { assign } from 'vs/base/common/objects';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ISCMService, ISCMRepository, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations, ISCMResourceCollection, ISCMResourceSplice } from 'vs/workbench/services/scm/common/scm';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { ISCMService, ISCMRepository, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations } from 'vs/workbench/services/scm/common/scm';
import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeatures, SCMRawResourceSplices, SCMGroupFeatures, MainContext, IExtHostContext } from '../node/extHost.protocol';
import { Command } from 'vs/editor/common/modes';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
class MainThreadSCMResourceCollection implements ISCMResourceCollection {
readonly resources: ISCMResource[] = [];
private _onDidSplice = new Emitter<ISCMResourceSplice>();
readonly onDidSplice = this._onDidSplice.event;
splice(start: number, deleteCount: number, resources: ISCMResource[]) {
this.resources.splice(start, deleteCount, ...resources);
this._onDidSplice.fire({ start, deleteCount, resources });
}
}
import { ISplice, Sequence } from 'vs/base/common/sequence';
class MainThreadSCMResourceGroup implements ISCMResourceGroup {
readonly resourceCollection = new MainThreadSCMResourceCollection();
readonly elements: ISCMResource[] = [];
private _onDidSplice = new Emitter<ISplice<ISCMResource>>();
readonly onDidSplice = this._onDidSplice.event;
get hideWhenEmpty(): boolean { return this.features.hideWhenEmpty; }
private _onDidChange = new Emitter<void>();
get onDidChange(): Event<void> { return this._onDidChange.event; }
constructor(
private sourceControlHandle: number,
private handle: number,
@@ -51,6 +44,21 @@ class MainThreadSCMResourceGroup implements ISCMResourceGroup {
groupHandle: this.handle
};
}
splice(start: number, deleteCount: number, toInsert: ISCMResource[]) {
this.elements.splice(start, deleteCount, ...toInsert);
this._onDidSplice.fire({ start, deleteCount, toInsert });
}
$updateGroup(features: SCMGroupFeatures): void {
this.features = assign(this.features, features);
this._onDidChange.fire();
}
$updateGroupLabel(label: string): void {
this.label = label;
this._onDidChange.fire();
}
}
class MainThreadSCMResource implements ISCMResource {
@@ -85,13 +93,18 @@ class MainThreadSCMProvider implements ISCMProvider {
private _id = `scm${MainThreadSCMProvider.ID_HANDLE++}`;
get id(): string { return this._id; }
private _groups: MainThreadSCMResourceGroup[] = [];
readonly groups = new Sequence<MainThreadSCMResourceGroup>();
private _groupsByHandle: { [handle: number]: MainThreadSCMResourceGroup; } = Object.create(null);
get resources(): ISCMResourceGroup[] {
return this._groups
.filter(g => g.resourceCollection.resources.length > 0 || !g.features.hideWhenEmpty);
}
// get groups(): ISequence<ISCMResourceGroup> {
// return {
// elements: this._groups,
// onDidSplice: this._onDidSplice.event
// };
// // return this._groups
// // .filter(g => g.resources.elements.length > 0 || !g.features.hideWhenEmpty);
// }
private _onDidChangeResources = new Emitter<void>();
get onDidChangeResources(): Event<void> { return this._onDidChangeResources.event; }
@@ -120,8 +133,7 @@ class MainThreadSCMProvider implements ISCMProvider {
private _contextValue: string,
private _label: string,
private _rootUri: URI | undefined,
@ISCMService scmService: ISCMService,
@ICommandService private commandService: ICommandService
@ISCMService scmService: ISCMService
) { }
$updateSourceControl(features: SCMProviderFeatures): void {
@@ -143,8 +155,8 @@ class MainThreadSCMProvider implements ISCMProvider {
id
);
this._groups.push(group);
this._groupsByHandle[handle] = group;
this.groups.splice(this.groups.elements.length, 0, [group]);
}
$updateGroup(handle: number, features: SCMGroupFeatures): void {
@@ -154,8 +166,7 @@ class MainThreadSCMProvider implements ISCMProvider {
return;
}
group.features = assign(group.features, features);
this._onDidChange.fire();
group.$updateGroup(features);
}
$updateGroupLabel(handle: number, label: string): void {
@@ -165,8 +176,7 @@ class MainThreadSCMProvider implements ISCMProvider {
return;
}
group.label = label;
this._onDidChange.fire();
group.$updateGroupLabel(label);
}
$spliceGroupResourceStates(splices: SCMRawResourceSplices[]): void {
@@ -208,7 +218,7 @@ class MainThreadSCMProvider implements ISCMProvider {
);
});
group.resourceCollection.splice(start, deleteCount, resources);
group.splice(start, deleteCount, resources);
}
}
@@ -223,7 +233,7 @@ class MainThreadSCMProvider implements ISCMProvider {
}
delete this._groupsByHandle[handle];
this._groups.splice(this._groups.indexOf(group), 1);
this.groups.splice(this.groups.elements.indexOf(group), 1);
}
getOriginalResource(uri: URI): TPromise<URI> {
@@ -256,9 +266,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
constructor(
extHostContext: IExtHostContext,
@IInstantiationService private instantiationService: IInstantiationService,
@ISCMService private scmService: ISCMService,
@ICommandService private commandService: ICommandService
@ISCMService private scmService: ISCMService
) {
this._proxy = extHostContext.get(ExtHostContext.ExtHostSCM);
}
@@ -276,7 +284,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
}
$registerSourceControl(handle: number, id: string, label: string, rootUri: string | undefined): void {
const provider = new MainThreadSCMProvider(this._proxy, handle, id, label, rootUri && URI.parse(rootUri), this.scmService, this.commandService);
const provider = new MainThreadSCMProvider(this._proxy, handle, id, label, rootUri && URI.parse(rootUri), this.scmService);
const repository = this.scmService.registerSCMProvider(provider);
this._repositories[handle] = repository;
@@ -373,4 +381,14 @@ export class MainThreadSCM implements MainThreadSCMShape {
repository.input.value = value;
}
$setInputBoxPlaceholder(sourceControlHandle: number, placeholder: string): void {
const repository = this._repositories[sourceControlHandle];
if (!repository) {
return;
}
repository.input.placeholder = placeholder;
}
}