Rename jumpToUsage => jumpToMethod throughout
This commit is contained in:
@@ -323,7 +323,7 @@ export type PackagingCommands = {
|
||||
export type ModelEditorCommands = {
|
||||
"codeQL.openModelEditor": () => Promise<void>;
|
||||
"codeQL.openModelEditorFromModelingPanel": () => Promise<void>;
|
||||
"codeQLModelEditor.jumpToUsageLocation": (
|
||||
"codeQLModelEditor.jumpToMethod": (
|
||||
methodSignature: string,
|
||||
databaseItem: DatabaseItem,
|
||||
) => Promise<void>;
|
||||
|
||||
@@ -526,8 +526,8 @@ interface SwitchModeMessage {
|
||||
mode: Mode;
|
||||
}
|
||||
|
||||
interface JumpToUsageMessage {
|
||||
t: "jumpToUsage";
|
||||
interface JumpToMethodMessage {
|
||||
t: "jumpToMethod";
|
||||
methodSignature: string;
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ export type FromModelEditorMessage =
|
||||
| RefreshMethods
|
||||
| OpenDatabaseMessage
|
||||
| OpenExtensionPackMessage
|
||||
| JumpToUsageMessage
|
||||
| JumpToMethodMessage
|
||||
| SaveModeledMethods
|
||||
| GenerateMethodMessage
|
||||
| GenerateMethodsFromLlmMessage
|
||||
|
||||
@@ -94,7 +94,7 @@ export class MethodsUsageDataProvider
|
||||
collapsibleState: TreeItemCollapsibleState.None,
|
||||
command: {
|
||||
title: "Show usage",
|
||||
command: "codeQLModelEditor.jumpToUsageLocation",
|
||||
command: "codeQLModelEditor.jumpToMethod",
|
||||
arguments: [method.signature, this.databaseItem],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ export class ModelEditorModule extends DisposableObject {
|
||||
"codeQL.openModelEditor": this.openModelEditor.bind(this),
|
||||
"codeQL.openModelEditorFromModelingPanel":
|
||||
this.openModelEditor.bind(this),
|
||||
"codeQLModelEditor.jumpToUsageLocation": async (
|
||||
"codeQLModelEditor.jumpToMethod": async (
|
||||
methodSignature: string,
|
||||
databaseItem: DatabaseItem,
|
||||
) => {
|
||||
|
||||
@@ -197,9 +197,11 @@ export class ModelEditorView extends AbstractWebview<
|
||||
);
|
||||
|
||||
break;
|
||||
case "jumpToUsage":
|
||||
await this.handleJumpToUsage(msg.methodSignature);
|
||||
void telemetryListener?.sendUIInteraction("model-editor-jump-to-usage");
|
||||
case "jumpToMethod":
|
||||
await this.handleJumpToMethod(msg.methodSignature);
|
||||
void telemetryListener?.sendUIInteraction(
|
||||
"model-editor-jump-to-method",
|
||||
);
|
||||
|
||||
break;
|
||||
case "saveModeledMethods":
|
||||
@@ -361,7 +363,7 @@ export class ModelEditorView extends AbstractWebview<
|
||||
});
|
||||
}
|
||||
|
||||
protected async handleJumpToUsage(methodSignature: string) {
|
||||
protected async handleJumpToMethod(methodSignature: string) {
|
||||
this.modelingStore.setSelectedMethod(this.databaseItem, methodSignature);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
|
||||
onChange,
|
||||
} = props;
|
||||
|
||||
const jumpToUsage = useCallback(
|
||||
() => sendJumpToUsageMessage(method),
|
||||
const jumpToMethod = useCallback(
|
||||
() => sendJumpToMethodMessage(method),
|
||||
[method],
|
||||
);
|
||||
|
||||
@@ -113,11 +113,11 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
|
||||
<MethodClassifications method={method} />
|
||||
<MethodName {...props.method} />
|
||||
{mode === Mode.Application && (
|
||||
<UsagesButton onClick={jumpToUsage}>
|
||||
<UsagesButton onClick={jumpToMethod}>
|
||||
{method.usages.length}
|
||||
</UsagesButton>
|
||||
)}
|
||||
<ViewLink onClick={jumpToUsage}>View</ViewLink>
|
||||
<ViewLink onClick={jumpToMethod}>View</ViewLink>
|
||||
{props.modelingInProgress && <ProgressRing />}
|
||||
</ApiOrMethodCell>
|
||||
{props.modelingInProgress && (
|
||||
@@ -180,8 +180,8 @@ const UnmodelableMethodRow = forwardRef<
|
||||
>((props, ref) => {
|
||||
const { method, mode, revealedMethodSignature } = props;
|
||||
|
||||
const jumpToUsage = useCallback(
|
||||
() => sendJumpToUsageMessage(method),
|
||||
const jumpToMethod = useCallback(
|
||||
() => sendJumpToMethodMessage(method),
|
||||
[method],
|
||||
);
|
||||
|
||||
@@ -195,11 +195,11 @@ const UnmodelableMethodRow = forwardRef<
|
||||
<ModelingStatusIndicator status="saved" />
|
||||
<MethodName {...props.method} />
|
||||
{mode === Mode.Application && (
|
||||
<UsagesButton onClick={jumpToUsage}>
|
||||
<UsagesButton onClick={jumpToMethod}>
|
||||
{method.usages.length}
|
||||
</UsagesButton>
|
||||
)}
|
||||
<ViewLink onClick={jumpToUsage}>View</ViewLink>
|
||||
<ViewLink onClick={jumpToMethod}>View</ViewLink>
|
||||
<MethodClassifications method={method} />
|
||||
</ApiOrMethodCell>
|
||||
<VSCodeDataGridCell gridColumn="span 4">
|
||||
@@ -210,9 +210,9 @@ const UnmodelableMethodRow = forwardRef<
|
||||
});
|
||||
UnmodelableMethodRow.displayName = "UnmodelableMethodRow";
|
||||
|
||||
function sendJumpToUsageMessage(method: Method) {
|
||||
function sendJumpToMethodMessage(method: Method) {
|
||||
vscode.postMessage({
|
||||
t: "jumpToUsage",
|
||||
t: "jumpToMethod",
|
||||
methodSignature: method.signature,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user