Merge pull request #2811 from github/robertbrignull/fix-jump-to-usage

Fix jumping to usage and updating method modeling panel
This commit is contained in:
Robert
2023-09-13 13:07:24 +01:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ import type {
} from "../variant-analysis/shared/variant-analysis"; } from "../variant-analysis/shared/variant-analysis";
import type { QLDebugConfiguration } from "../debugger/debug-configuration"; import type { QLDebugConfiguration } from "../debugger/debug-configuration";
import type { QueryTreeViewItem } from "../queries-panel/query-tree-view-item"; import type { QueryTreeViewItem } from "../queries-panel/query-tree-view-item";
import type { Usage } from "../model-editor/method"; import type { Method, Usage } from "../model-editor/method";
// A command function matching the signature that VS Code calls when // A command function matching the signature that VS Code calls when
// a command is invoked from a context menu on a TreeView with // a command is invoked from a context menu on a TreeView with
@@ -306,6 +306,7 @@ export type PackagingCommands = {
export type ModelEditorCommands = { export type ModelEditorCommands = {
"codeQL.openModelEditor": () => Promise<void>; "codeQL.openModelEditor": () => Promise<void>;
"codeQLModelEditor.jumpToUsageLocation": ( "codeQLModelEditor.jumpToUsageLocation": (
method: Method,
usage: Usage, usage: Usage,
databaseItem: DatabaseItem, databaseItem: DatabaseItem,
) => Promise<void>; ) => Promise<void>;

View File

@@ -177,9 +177,11 @@ export class ModelEditorModule extends DisposableObject {
); );
}, },
"codeQLModelEditor.jumpToUsageLocation": async ( "codeQLModelEditor.jumpToUsageLocation": async (
method: Method,
usage: Usage, usage: Usage,
databaseItem: DatabaseItem, databaseItem: DatabaseItem,
) => { ) => {
await this.methodModelingPanel.setMethod(method);
await showResolvableLocation(usage.url, databaseItem, this.app.logger); await showResolvableLocation(usage.url, databaseItem, this.app.logger);
}, },
}; };