Revert "Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)" (#5983)

This reverts commit d15a3fcc98.
This commit is contained in:
Karl Burtram
2019-06-11 12:35:58 -07:00
committed by GitHub
parent 95a50b7892
commit 5a7562a37b
926 changed files with 11394 additions and 19540 deletions

View File

@@ -194,7 +194,7 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.lenses.length, 1);
assert.equal(value.length, 1);
});
test('CodeLens, do not resolve a resolved lens', async () => {
@@ -212,8 +212,8 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.lenses.length, 1);
const [data] = value.lenses;
assert.equal(value.length, 1);
const data = value[0];
const symbol = await Promise.resolve(data.provider.resolveCodeLens!(model, data.symbol, CancellationToken.None));
assert.equal(symbol!.command!.id, 'id');
assert.equal(symbol!.command!.title, 'Title');
@@ -229,8 +229,8 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.lenses.length, 1);
let [data] = value.lenses;
assert.equal(value.length, 1);
let data = value[0];
const symbol = await Promise.resolve(data.provider.resolveCodeLens!(model, data.symbol, CancellationToken.None));
assert.equal(symbol!.command!.id, 'missing');
assert.equal(symbol!.command!.title, '!!MISSING: command!!');
@@ -1041,9 +1041,7 @@ suite('ExtHostLanguageFeatures', function () {
disposables.push(extHost.registerDocumentLinkProvider(defaultExtension, defaultSelector, new class implements vscode.DocumentLinkProvider {
provideDocumentLinks() {
const link = new types.DocumentLink(new types.Range(0, 0, 1, 1), URI.parse('foo:bar#3'));
link.tooltip = 'tooltip';
return [link];
return [new types.DocumentLink(new types.Range(0, 0, 1, 1), URI.parse('foo:bar#3'))];
}
}));
@@ -1053,7 +1051,6 @@ suite('ExtHostLanguageFeatures', function () {
let [first] = links;
assert.equal(first.url, 'foo:bar#3');
assert.deepEqual(first.range, { startLineNumber: 1, startColumn: 1, endLineNumber: 2, endColumn: 2 });
assert.equal(first.tooltip, 'tooltip');
});
test('Links, evil provider', async () => {

View File

@@ -6,11 +6,9 @@
import * as assert from 'assert';
import { MainThreadMessageService } from 'vs/workbench/api/browser/mainThreadMessageService';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions, IStatusMessageOptions } from 'vs/platform/notification/common/notification';
import { INotificationService, INotification, NoOpNotification, INotificationHandle, Severity, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
const emptyDialogService = new class implements IDialogService {
_serviceBrand: 'dialogService';
@@ -32,7 +30,7 @@ const emptyCommandService: ICommandService = {
};
const emptyNotificationService = new class implements INotificationService {
_serviceBrand: ServiceIdentifier<INotificationService>;
_serviceBrand: 'notificiationService';
notify(...args: any[]): never {
throw new Error('not implemented');
}
@@ -48,13 +46,11 @@ const emptyNotificationService = new class implements INotificationService {
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
throw new Error('not implemented');
}
status(message: string | Error, options?: IStatusMessageOptions): IDisposable {
return Disposable.None;
}
};
class EmptyNotificationService implements INotificationService {
_serviceBrand: ServiceIdentifier<INotificationService>;
_serviceBrand: any;
constructor(private withNotify: (notification: INotification) => void) {
}
@@ -76,9 +72,6 @@ class EmptyNotificationService implements INotificationService {
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
throw new Error('not implemented');
}
status(message: string, options?: IStatusMessageOptions): IDisposable {
return Disposable.None;
}
}
suite('ExtHostMessageService', function () {

View File

@@ -7,7 +7,7 @@ import * as assert from 'assert';
import { mapArrayOrNot } from 'vs/base/common/arrays';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { isPromiseCanceledError } from 'vs/base/common/errors';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { dispose } from 'vs/base/common/lifecycle';
import { joinPath } from 'vs/base/common/resources';
import { URI, UriComponents } from 'vs/base/common/uri';
import * as pfs from 'vs/base/node/pfs';
@@ -21,7 +21,7 @@ import * as vscode from 'vscode';
let rpcProtocol: TestRPCProtocol;
let extHostSearch: ExtHostSearch;
const disposables = new DisposableStore();
let disposables: vscode.Disposable[] = [];
let mockMainThreadSearch: MockMainThreadSearch;
class MockMainThreadSearch implements MainThreadSearchShape {
@@ -63,12 +63,12 @@ export function extensionResultIsMatch(data: vscode.TextSearchResult): data is v
suite('ExtHostSearch', () => {
async function registerTestTextSearchProvider(provider: vscode.TextSearchProvider, scheme = 'file'): Promise<void> {
disposables.add(extHostSearch.registerTextSearchProvider(scheme, provider));
disposables.push(extHostSearch.registerTextSearchProvider(scheme, provider));
await rpcProtocol.sync();
}
async function registerTestFileSearchProvider(provider: vscode.FileSearchProvider, scheme = 'file'): Promise<void> {
disposables.add(extHostSearch.registerFileSearchProvider(scheme, provider));
disposables.push(extHostSearch.registerFileSearchProvider(scheme, provider));
await rpcProtocol.sync();
}
@@ -139,7 +139,7 @@ suite('ExtHostSearch', () => {
});
teardown(() => {
disposables.clear();
dispose(disposables);
return rpcProtocol.sync();
});

View File

@@ -31,7 +31,6 @@ suite('ExtHostTypes', function () {
scheme: 'file',
path: '/path/test.file',
fsPath: '/path/test.file'.replace(/\//g, isWindows ? '\\' : '/'),
_sep: isWindows ? 1 : undefined,
});
assert.ok(uri.toString());
@@ -40,7 +39,6 @@ suite('ExtHostTypes', function () {
scheme: 'file',
path: '/path/test.file',
fsPath: '/path/test.file'.replace(/\//g, isWindows ? '\\' : '/'),
_sep: isWindows ? 1 : undefined,
external: 'file:///path/test.file'
});
});

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { MainThreadWebviews } from 'vs/workbench/api/browser/mainThreadWebview';
import { MainThreadWebviews } from 'vs/workbench/api/electron-browser/mainThreadWebview';
import { ExtHostWebviews } from 'vs/workbench/api/common/extHostWebview';
import { mock } from 'vs/workbench/test/electron-browser/api/mock';
import * as vscode from 'vscode';

View File

@@ -62,7 +62,7 @@ suite('MainThreadEditors', () => {
}
move(source: URI, target: URI) {
movedResources.set(source, target);
return Promise.resolve(Object.create(null));
return Promise.resolve(undefined);
}
models = <any>{
onModelSaved: Event.None,