From ccd53133a977f346416992851084fd7cd1f0e9f3 Mon Sep 17 00:00:00 2001 From: Shati Patel <42641846+shati-patel@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:54:42 +0000 Subject: [PATCH] Use wider type for "reveal in model editor" (#3512) --- extensions/ql-vscode/src/common/interface-types.ts | 4 ++-- .../method-modeling/method-modeling-view-provider.ts | 4 ++-- extensions/ql-vscode/src/model-editor/model-editor-view.ts | 4 ++-- extensions/ql-vscode/src/model-editor/modeling-events.ts | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/extensions/ql-vscode/src/common/interface-types.ts b/extensions/ql-vscode/src/common/interface-types.ts index 5f72f662d..f6f56743a 100644 --- a/extensions/ql-vscode/src/common/interface-types.ts +++ b/extensions/ql-vscode/src/common/interface-types.ts @@ -10,7 +10,7 @@ import type { } from "../variant-analysis/shared/variant-analysis-filter-sort"; import type { ErrorLike } from "../common/errors"; import type { DataFlowPaths } from "../variant-analysis/shared/data-flow-paths"; -import type { Method } from "../model-editor/method"; +import type { Method, MethodSignature } from "../model-editor/method"; import type { ModeledMethod } from "../model-editor/modeled-method"; import type { MethodModelingPanelViewState, @@ -681,7 +681,7 @@ export type FromModelEditorMessage = interface RevealInEditorMessage { t: "revealInModelEditor"; - method: Method; + method: MethodSignature; } interface StartModelingMessage { diff --git a/extensions/ql-vscode/src/model-editor/method-modeling/method-modeling-view-provider.ts b/extensions/ql-vscode/src/model-editor/method-modeling/method-modeling-view-provider.ts index df9c9c346..d325bb72f 100644 --- a/extensions/ql-vscode/src/model-editor/method-modeling/method-modeling-view-provider.ts +++ b/extensions/ql-vscode/src/model-editor/method-modeling/method-modeling-view-provider.ts @@ -6,7 +6,7 @@ import { telemetryListener } from "../../common/vscode/telemetry"; import { showAndLogExceptionWithTelemetry } from "../../common/logging/notifications"; import type { App } from "../../common/app"; import { redactableError } from "../../common/errors"; -import type { Method } from "../method"; +import type { Method, MethodSignature } from "../method"; import type { ModelingStore } from "../modeling-store"; import { AbstractWebviewViewProvider } from "../../common/vscode/abstract-webview-view-provider"; import { assertNever } from "../../common/helpers-pure"; @@ -163,7 +163,7 @@ export class MethodModelingViewProvider extends AbstractWebviewViewProvider< } } - private async revealInModelEditor(method: Method): Promise { + private async revealInModelEditor(method: MethodSignature): Promise { if (!this.databaseItem) { return; } diff --git a/extensions/ql-vscode/src/model-editor/model-editor-view.ts b/extensions/ql-vscode/src/model-editor/model-editor-view.ts index 02abf5bbe..adf0d0838 100644 --- a/extensions/ql-vscode/src/model-editor/model-editor-view.ts +++ b/extensions/ql-vscode/src/model-editor/model-editor-view.ts @@ -36,7 +36,7 @@ import { externalApiQueriesProgressMaxStep, runModelEditorQueries, } from "./model-editor-queries"; -import type { Method } from "./method"; +import type { MethodSignature } from "./method"; import type { ModeledMethod } from "./modeled-method"; import type { ExtensionPack } from "./shared/extension-pack"; import type { ModelConfigListener } from "../config"; @@ -431,7 +431,7 @@ export class ModelEditorView extends AbstractWebview< this.panel?.reveal(); } - public async revealMethod(method: Method): Promise { + public async revealMethod(method: MethodSignature): Promise { this.panel?.reveal(); await this.postMessage({ diff --git a/extensions/ql-vscode/src/model-editor/modeling-events.ts b/extensions/ql-vscode/src/model-editor/modeling-events.ts index c1f3a7d6e..bffd9b4ac 100644 --- a/extensions/ql-vscode/src/model-editor/modeling-events.ts +++ b/extensions/ql-vscode/src/model-editor/modeling-events.ts @@ -2,7 +2,7 @@ import type { App } from "../common/app"; import { DisposableObject } from "../common/disposable-object"; import type { AppEvent, AppEventEmitter } from "../common/events"; import type { DatabaseItem } from "../databases/local-databases"; -import type { Method, Usage } from "./method"; +import type { Method, MethodSignature, Usage } from "./method"; import type { ModelEvaluationRun } from "./model-evaluation-run"; import type { ModeledMethod } from "./modeled-method"; import type { Mode } from "./shared/mode"; @@ -58,7 +58,7 @@ interface ModelEvaluationRunChangedEvent { interface RevealInModelEditorEvent { dbUri: string; - method: Method; + method: MethodSignature; } interface FocusModelEditorEvent { @@ -285,7 +285,7 @@ export class ModelingEvents extends DisposableObject { }); } - public fireRevealInModelEditorEvent(dbUri: string, method: Method) { + public fireRevealInModelEditorEvent(dbUri: string, method: MethodSignature) { this.onRevealInModelEditorEventEmitter.fire({ dbUri, method,