Focus on panel when clicking view button
This commit is contained in:
@@ -1658,7 +1658,7 @@
|
||||
],
|
||||
"panel": [
|
||||
{
|
||||
"id": "codeql-model-details-view",
|
||||
"id": "codeql-model-details",
|
||||
"title": "CodeQL Model Details",
|
||||
"icon": "media/logo.svg"
|
||||
}
|
||||
@@ -1693,7 +1693,7 @@
|
||||
"when": "config.codeQL.canary"
|
||||
}
|
||||
],
|
||||
"codeql-model-details-view": [
|
||||
"codeql-model-details": [
|
||||
{
|
||||
"id": "codeQLModelDetails",
|
||||
"name": "CodeQL Model Details",
|
||||
|
||||
@@ -58,6 +58,7 @@ export type ExplorerSelectionCommandFunction<Item> = (
|
||||
type BuiltInVsCodeCommands = {
|
||||
// The codeQLDatabases.focus command is provided by VS Code because we've registered the custom view
|
||||
"codeQLDatabases.focus": () => Promise<void>;
|
||||
"codeQLModelDetails.focus": () => Promise<void>;
|
||||
"markdown.showPreviewToSide": (uri: Uri) => Promise<void>;
|
||||
"workbench.action.closeActiveEditor": () => Promise<void>;
|
||||
revealFileInOS: (uri: Uri) => Promise<void>;
|
||||
|
||||
@@ -47,6 +47,7 @@ import {
|
||||
import {
|
||||
enableFrameworkMode,
|
||||
showLlmGeneration,
|
||||
showModelDetailsView,
|
||||
useLlmGenerationV2,
|
||||
} from "../config";
|
||||
import { getAutoModelUsages } from "./auto-model-usages-query";
|
||||
@@ -138,7 +139,7 @@ export class DataExtensionsEditorView extends AbstractWebview<
|
||||
|
||||
break;
|
||||
case "jumpToUsage":
|
||||
await this.jumpToUsage(msg.location);
|
||||
await this.handleJumpToUsage(msg.location);
|
||||
|
||||
break;
|
||||
case "saveModeledMethods":
|
||||
@@ -211,6 +212,18 @@ export class DataExtensionsEditorView extends AbstractWebview<
|
||||
});
|
||||
}
|
||||
|
||||
protected async handleJumpToUsage(location: ResolvableLocationValue) {
|
||||
if (showModelDetailsView()) {
|
||||
await this.openModelDetailsView();
|
||||
} else {
|
||||
await this.jumpToUsage(location);
|
||||
}
|
||||
}
|
||||
|
||||
protected async openModelDetailsView() {
|
||||
await this.app.commands.execute("codeQLModelDetails.focus");
|
||||
}
|
||||
|
||||
protected async jumpToUsage(
|
||||
location: ResolvableLocationValue,
|
||||
): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user