mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
@@ -171,7 +171,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
const extHostWebviewPanels = rpcProtocol.set(ExtHostContext.ExtHostWebviewPanels, new ExtHostWebviewPanels(rpcProtocol, extHostWebviews, extHostWorkspace));
|
||||
const extHostCustomEditors = rpcProtocol.set(ExtHostContext.ExtHostCustomEditors, new ExtHostCustomEditors(rpcProtocol, extHostDocuments, extensionStoragePaths, extHostWebviews, extHostWebviewPanels));
|
||||
const extHostWebviewViews = rpcProtocol.set(ExtHostContext.ExtHostWebviewViews, new ExtHostWebviewViews(rpcProtocol, extHostWebviews));
|
||||
const extHostTesting = rpcProtocol.set(ExtHostContext.ExtHostTesting, new ExtHostTesting(rpcProtocol));
|
||||
const extHostTesting = rpcProtocol.set(ExtHostContext.ExtHostTesting, new ExtHostTesting(rpcProtocol, extHostCommands));
|
||||
const extHostUriOpeners = rpcProtocol.set(ExtHostContext.ExtHostUriOpeners, new ExtHostUriOpeners(rpcProtocol));
|
||||
|
||||
// Check that no named customers are missing
|
||||
|
||||
@@ -11,10 +11,12 @@ import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { once } from 'vs/base/common/functional';
|
||||
import { Iterable } from 'vs/base/common/iterator';
|
||||
import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { MarshalledId } from 'vs/base/common/marshalling';
|
||||
import { deepFreeze } from 'vs/base/common/objects';
|
||||
import { isDefined } from 'vs/base/common/types';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { ExtHostTestingShape, MainContext, MainThreadTestingShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
|
||||
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
|
||||
import * as Convert from 'vs/workbench/api/common/extHostTypeConverters';
|
||||
import { TestItemImpl } from 'vs/workbench/api/common/extHostTypes';
|
||||
@@ -35,10 +37,15 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
public onResultsChanged = this.resultsChangedEmitter.event;
|
||||
public results: ReadonlyArray<vscode.TestRunResult> = [];
|
||||
|
||||
constructor(@IExtHostRpcService rpc: IExtHostRpcService) {
|
||||
constructor(@IExtHostRpcService rpc: IExtHostRpcService, commands: ExtHostCommands) {
|
||||
this.proxy = rpc.getProxy(MainContext.MainThreadTesting);
|
||||
this.observer = new TestObservers(this.proxy);
|
||||
this.runTracker = new TestRunCoordinator(this.proxy);
|
||||
|
||||
commands.registerArgumentProcessor({
|
||||
processArgument: arg =>
|
||||
arg?.$mid === MarshalledId.TestItemContext ? Convert.TestItem.toItemFromContext(arg) : arg,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ import { EditorGroupColumn, SaveReason } from 'vs/workbench/common/editor';
|
||||
import * as notebooks from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { ICellRange } from 'vs/workbench/contrib/notebook/common/notebookRange';
|
||||
import * as search from 'vs/workbench/contrib/search/common/search';
|
||||
import { ISerializedTestResults, ITestItem, ITestMessage, SerializedTestResultItem } from 'vs/workbench/contrib/testing/common/testCollection';
|
||||
import { ISerializedTestResults, ITestItem, ITestItemContext, ITestMessage, SerializedTestResultItem } from 'vs/workbench/contrib/testing/common/testCollection';
|
||||
import { ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import type * as vscode from 'vscode';
|
||||
import * as types from './extHostTypes';
|
||||
@@ -1677,14 +1677,23 @@ export namespace TestItem {
|
||||
};
|
||||
}
|
||||
|
||||
export function to(item: ITestItem): types.TestItemImpl {
|
||||
const testItem = new types.TestItemImpl(item.extId, item.label, URI.revive(item.uri), undefined, undefined);
|
||||
export function to(item: ITestItem, parent?: vscode.TestItem<void>): types.TestItemImpl<void> {
|
||||
const testItem = new types.TestItemImpl(item.extId, item.label, URI.revive(item.uri), undefined, parent);
|
||||
testItem.range = Range.to(item.range || undefined);
|
||||
testItem.debuggable = item.debuggable;
|
||||
testItem.description = item.description || undefined;
|
||||
testItem.runnable = item.runnable;
|
||||
return testItem;
|
||||
}
|
||||
|
||||
export function toItemFromContext(context: ITestItemContext): types.TestItemImpl<void> {
|
||||
let node: types.TestItemImpl<void> | undefined;
|
||||
for (const test of context.tests) {
|
||||
node = to(test.item, node);
|
||||
}
|
||||
|
||||
return node!;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace TestResults {
|
||||
|
||||
Reference in New Issue
Block a user