Include full usage in jumpToUsage message

This commit is contained in:
Robert
2023-08-08 15:57:30 +01:00
parent 209822e093
commit 805bb74a8a
3 changed files with 9 additions and 6 deletions

View File

@@ -17,7 +17,10 @@ import {
} from "../variant-analysis/shared/variant-analysis-filter-sort";
import { ErrorLike } from "../common/errors";
import { DataFlowPaths } from "../variant-analysis/shared/data-flow-paths";
import { ExternalApiUsage } from "../data-extensions-editor/external-api-usage";
import {
ExternalApiUsage,
Usage,
} from "../data-extensions-editor/external-api-usage";
import { ModeledMethod } from "../data-extensions-editor/modeled-method";
import { DataExtensionEditorViewState } from "../data-extensions-editor/shared/view-state";
import { Mode } from "../data-extensions-editor/shared/mode";
@@ -522,7 +525,7 @@ interface SwitchModeMessage {
interface JumpToUsageMessage {
t: "jumpToUsage";
location: ResolvableLocationValue;
usage: Usage;
}
interface OpenDatabaseMessage {

View File

@@ -153,7 +153,7 @@ export class DataExtensionsEditorView extends AbstractWebview<
break;
case "jumpToUsage":
await this.handleJumpToUsage(msg.location);
await this.handleJumpToUsage(msg.usage);
break;
case "saveModeledMethods":
@@ -230,11 +230,11 @@ export class DataExtensionsEditorView extends AbstractWebview<
});
}
protected async handleJumpToUsage(location: ResolvableLocationValue) {
protected async handleJumpToUsage(usage: Usage) {
if (showModelDetailsView()) {
await this.openModelDetailsView();
} else {
await this.jumpToUsage(location);
await this.jumpToUsage(usage.url);
}
}

View File

@@ -326,7 +326,7 @@ function sendJumpToUsageMessage(externalApiUsage: ExternalApiUsage) {
vscode.postMessage({
t: "jumpToUsage",
// In framework mode, the first and only usage is the definition of the method
location: externalApiUsage.usages[0].url,
usage: externalApiUsage.usages[0],
});
}