Remove UIService
This class seems to have been introduced at some point to reduce the dependency on VS Code from the test UI service. However, none of its methods are being used anymore, and by using typed commands we have already reduced the dependency on VS Code. Therefore, we can simply remove this class.
This commit is contained in:
@@ -14,7 +14,6 @@ import {
|
||||
import { showAndLogWarningMessage } from "./helpers";
|
||||
import { TestTreeNode } from "./test-tree-node";
|
||||
import { DisposableObject } from "./pure/disposable-object";
|
||||
import { UIService } from "./vscode-utils/ui-service";
|
||||
import { QLTestAdapter, getExpectedFile, getActualFile } from "./test-adapter";
|
||||
import { TestUICommands } from "./common/commands";
|
||||
|
||||
@@ -42,7 +41,7 @@ class QLTestListener extends DisposableObject {
|
||||
/**
|
||||
* Service that implements all UI and commands for QL tests.
|
||||
*/
|
||||
export class TestUIService extends UIService implements TestController {
|
||||
export class TestUIService extends DisposableObject implements TestController {
|
||||
private readonly listeners: Map<TestAdapter, QLTestListener> = new Map();
|
||||
|
||||
constructor(private readonly testHub: TestHub) {
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import { TreeDataProvider, window } from "vscode";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { commandRunner } from "../commandRunner";
|
||||
|
||||
/**
|
||||
* A VS Code service that interacts with the UI, including handling commands.
|
||||
*/
|
||||
export class UIService extends DisposableObject {
|
||||
protected constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a command handler with Visual Studio Code.
|
||||
* @param command The ID of the command to register.
|
||||
* @param callback Callback function to implement the command.
|
||||
* @remarks The command handler is automatically unregistered when the service is disposed.
|
||||
*/
|
||||
protected registerCommand(
|
||||
command: string,
|
||||
callback: (...args: any[]) => any,
|
||||
): void {
|
||||
this.push(commandRunner(command, callback.bind(this)));
|
||||
}
|
||||
|
||||
protected registerTreeDataProvider<T>(
|
||||
viewId: string,
|
||||
treeDataProvider: TreeDataProvider<T>,
|
||||
): void {
|
||||
this.push(window.registerTreeDataProvider<T>(viewId, treeDataProvider));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user