make vscode.revealTestInExplorer an api command

This commit is contained in:
Connor Peet
2021-09-01 16:53:38 -07:00
parent ae9c0c6a32
commit aac4d02082
5 changed files with 14 additions and 6 deletions

View File

@@ -422,6 +422,12 @@ const newCommands: ApiCommand[] = [
[ApiCommandArgument.TypeHierarchyItem],
new ApiCommandResult<ITypeHierarchyItemDto[], types.TypeHierarchyItem[]>('A TypeHierarchyItem or undefined', v => v.map(typeConverters.TypeHierarchyItem.to))
),
// --- testing
new ApiCommand(
'vscode.revealTestInExplorer', '_revealTestInExplorer', 'Reveals a test instance in the explorer',
[ApiCommandArgument.TestItem],
ApiCommandResult.Void
)
];
//#endregion

View File

@@ -21,6 +21,7 @@ import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
import { ISelection } from 'vs/editor/common/core/selection';
import { TestItemImpl } from 'vs/workbench/api/common/extHostTestingPrivateApi';
interface CommandHandler {
callback: Function;
@@ -371,6 +372,7 @@ export class ApiCommandArgument<V, O = V> {
static readonly CallHierarchyItem = new ApiCommandArgument('item', 'A call hierarchy item', v => v instanceof extHostTypes.CallHierarchyItem, extHostTypeConverter.CallHierarchyItem.from);
static readonly TypeHierarchyItem = new ApiCommandArgument('item', 'A type hierarchy item', v => v instanceof extHostTypes.TypeHierarchyItem, extHostTypeConverter.TypeHierarchyItem.from);
static readonly TestItem = new ApiCommandArgument('testItem', 'A VS Code TestItem', v => v instanceof TestItemImpl, extHostTypeConverter.TestItem.from);
constructor(
readonly name: string,