Merge remote-tracking branch 'upstream/master' into user/gabrield/extensionCallbackAsTask

This commit is contained in:
Gabriel DeBacker
2019-01-31 12:33:52 -08:00
127 changed files with 1884 additions and 1132 deletions

View File

@@ -256,7 +256,7 @@ export function createApiFactory(
get clipboard(): vscode.Clipboard {
return extHostClipboard;
},
open(uri: URI) {
openExternal(uri: URI) {
return extHostWindow.openUri(uri);
}
});

View File

@@ -591,6 +591,10 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
return Promise.resolve(undefined);
}
if (this._initData.autoStart) {
return Promise.resolve(undefined); // https://github.com/Microsoft/vscode/issues/66936
}
// Require the test runner via node require from the provided path
let testRunner: ITestRunner;
let requireError: Error;
@@ -669,8 +673,25 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
);
}
public $deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]): Promise<void> {
public async $deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]): Promise<void> {
toAdd.forEach((extension) => (<any>extension).extensionLocation = URI.revive(extension.extensionLocation));
const trie = await this.getExtensionPathIndex();
await Promise.all(toRemove.map(async (extensionId) => {
const extensionDescription = this._registry.getExtensionDescription(extensionId);
if (!extensionDescription) {
return;
}
const realpath = await pfs.realpath(extensionDescription.extensionLocation.fsPath);
trie.delete(URI.file(realpath).fsPath);
}));
await Promise.all(toAdd.map(async (extensionDescription) => {
const realpath = await pfs.realpath(extensionDescription.extensionLocation.fsPath);
trie.set(URI.file(realpath).fsPath, extensionDescription);
}));
this._registry.deltaExtensions(toAdd, toRemove);
return Promise.resolve(undefined);
}

View File

@@ -8,6 +8,7 @@ import { ExtHostWindowShape, MainContext, MainThreadWindowShape, IMainContext }
import { WindowState } from 'vscode';
import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network';
import { isFalsyOrWhitespace } from 'vs/base/common/strings';
export class ExtHostWindow implements ExtHostWindowShape {
@@ -38,7 +39,9 @@ export class ExtHostWindow implements ExtHostWindowShape {
}
openUri(uri: URI): Promise<boolean> {
if (uri.scheme === Schemas.command) {
if (isFalsyOrWhitespace(uri.scheme)) {
return Promise.reject('Invalid scheme - cannot be empty');
} else if (uri.scheme === Schemas.command) {
return Promise.reject(`Invalid scheme '${uri.scheme}'`);
}
return this._proxy.$openUri(uri);