Merge VS Code 1.21 source code (#1067)

* Initial VS Code 1.21 file copy with patches

* A few more merges

* Post npm install

* Fix batch of build breaks

* Fix more build breaks

* Fix more build errors

* Fix more build breaks

* Runtime fixes 1

* Get connection dialog working with some todos

* Fix a few packaging issues

* Copy several node_modules to package build to fix loader issues

* Fix breaks from master

* A few more fixes

* Make tests pass

* First pass of license header updates

* Second pass of license header updates

* Fix restore dialog issues

* Remove add additional themes menu items

* fix select box issues where the list doesn't show up

* formatting

* Fix editor dispose issue

* Copy over node modules to correct location on all platforms
This commit is contained in:
Karl Burtram
2018-04-04 15:27:51 -07:00
committed by GitHub
parent 5fba3e31b4
commit dafb780987
9412 changed files with 141255 additions and 98813 deletions

View File

@@ -6,11 +6,11 @@
'use strict';
import { TPromise } from 'vs/base/common/winjs.base';
import URI from 'vs/base/common/uri';
import URI, { UriComponents } 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 } from 'vs/workbench/services/scm/common/scm';
import { ISCMService, ISCMRepository, ISCMProvider, ISCMResource, ISCMResourceGroup, ISCMResourceDecorations, IInputValidation } 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';
@@ -212,7 +212,7 @@ class MainThreadSCMProvider implements ISCMProvider {
this.handle,
groupHandle,
handle,
URI.parse(sourceUri),
URI.revive(sourceUri),
group,
decorations
);
@@ -241,7 +241,8 @@ class MainThreadSCMProvider implements ISCMProvider {
return TPromise.as(null);
}
return this.proxy.$provideOriginalResource(this.handle, uri);
return this.proxy.$provideOriginalResource(this.handle, uri)
.then(result => result && URI.revive(result));
}
toJSON(): any {
@@ -268,7 +269,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
extHostContext: IExtHostContext,
@ISCMService private scmService: ISCMService
) {
this._proxy = extHostContext.get(ExtHostContext.ExtHostSCM);
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostSCM);
}
dispose(): void {
@@ -283,8 +284,8 @@ export class MainThreadSCM implements MainThreadSCMShape {
this._disposables = dispose(this._disposables);
}
$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);
$registerSourceControl(handle: number, id: string, label: string, rootUri: UriComponents | undefined): void {
const provider = new MainThreadSCMProvider(this._proxy, handle, id, label, rootUri && URI.revive(rootUri), this.scmService);
const repository = this.scmService.registerSCMProvider(provider);
this._repositories[handle] = repository;
@@ -391,4 +392,29 @@ export class MainThreadSCM implements MainThreadSCMShape {
repository.input.placeholder = placeholder;
}
$setValidationProviderIsEnabled(sourceControlHandle: number, enabled: boolean): void {
const repository = this._repositories[sourceControlHandle];
if (!repository) {
return;
}
if (enabled) {
repository.input.validateInput = async (value, pos): TPromise<IInputValidation | undefined> => {
const result = await this._proxy.$validateInput(sourceControlHandle, value, pos);
if (!result) {
return undefined;
}
return {
message: result[0],
type: result[1]
};
};
} else {
repository.input.validateInput = () => TPromise.as(undefined);
}
}
}