Remove unused arguments from resolveWebviewView

This commit is contained in:
Robert
2024-03-11 11:02:37 +00:00
parent 54cf5c55a8
commit dbd5d0f406
2 changed files with 5 additions and 23 deletions

View File

@@ -1,9 +1,4 @@
import type {
CancellationToken,
WebviewView,
WebviewViewProvider,
WebviewViewResolveContext,
} from "vscode";
import type { WebviewView, WebviewViewProvider } from "vscode";
import { Uri } from "vscode";
import type { WebviewKind, WebviewMessage } from "./webview-html";
import { getHtmlForWebview } from "./webview-html";
@@ -28,11 +23,7 @@ export abstract class AbstractWebviewViewProvider<
* This is called when a view first becomes visible. This may happen when the view is
* first loaded or when the user hides and then shows a view again.
*/
public resolveWebviewView(
webviewView: WebviewView,
_context: WebviewViewResolveContext,
_token: CancellationToken,
) {
public resolveWebviewView(webviewView: WebviewView) {
webviewView.webview.options = {
enableScripts: true,
localResourceRoots: [Uri.file(this.app.extensionPath)],

View File

@@ -1,10 +1,5 @@
import type {
Uri,
Webview,
WebviewView,
WebviewViewResolveContext,
} from "vscode";
import { CancellationTokenSource, EventEmitter } from "vscode";
import type { Uri, Webview, WebviewView } from "vscode";
import { EventEmitter } from "vscode";
import type { ModelConfigListener } from "../../../../../src/config";
import { MethodModelingViewProvider } from "../../../../../src/model-editor/method-modeling/method-modeling-view-provider";
import { createMockApp } from "../../../../__mocks__/appMock";
@@ -88,11 +83,7 @@ describe("method modeling view provider", () => {
onDidDispose: jest.fn(),
});
viewProvider.resolveWebviewView(
webviewView,
mockedObject<WebviewViewResolveContext>({}),
new CancellationTokenSource().token,
);
viewProvider.resolveWebviewView(webviewView);
expect(onDidReceiveMessage).toBeDefined();
});