You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Fix ${this.extractDiagnosticCode(diagnostic)} using Agentforce.`,
41
57
vscode.CodeActionKind.QuickFix
42
58
);
43
-
44
-
// Pass the diagnostic as an argument to the command
59
+
fixAction.diagnostics=[diagnostic]// Important (that we used to miss before): we should tie the code fix to the specific diagnostic.
45
60
fixAction.command={
46
61
title: 'Fix Diagnostic Issue',
47
-
command: Constants.UNIFIED_DIFF,
48
-
arguments: [document,diagnostic]// Pass the diagnostic here
62
+
command: Constants.UNIFIED_DIFF,// TODO: This really should be called something like QF_COMMAND_A4D_FIX... but it isn't because we are using the resolveCodeAction to do the A4D stuff instead before sending to unifieid diff.
63
+
arguments: [document,diagnostic]// Pass the document and diagnostic here.
49
64
};
50
-
51
65
codeActions.push(fixAction);
52
-
});
66
+
}
53
67
54
68
returncodeActions;
55
69
}
@@ -62,6 +76,8 @@ export class AgentforceViolationsFixer implements vscode.CodeActionProvider {
// TODO: Evaluate if this even should be used. It clearly does more than its responsibility of just resolving the code action... it performs work by invoking the callLLM stuff and updates the existing UNIFIED_DIFF command's arguments before actually executing the unified diff.
80
+
// I think we will probably benefit from removing this and instead just have the code action trigger a QF_COMMAND_A4D_FIX which can optionally then trigger a COMMAND_UNIFIED_DIFF or something.
65
81
publicresolveCodeAction(
66
82
codeAction: vscode.CodeAction,
67
83
token: vscode.CancellationToken
@@ -78,7 +94,8 @@ export class AgentforceViolationsFixer implements vscode.CodeActionProvider {
// See https://github.com/forcedotcom/salesforcedx-vscode/blob/develop/packages/salesforcedx-utils-vscode/src/services/telemetry.ts#L78
23
+
// and https://github.com/forcedotcom/salesforcedx-vscode/blob/develop/packages/salesforcedx-vscode-core/src/services/telemetry/telemetryServiceProvider.ts#L19
0 commit comments