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
Copy file name to clipboardExpand all lines: src/lib/messages.ts
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,9 @@ export const messages = {
14
14
processingResults: "Code Analyzer is processing results."// Shared with ApexGuru and CodeAnalyzer
15
15
},
16
16
agentforce: {
17
-
a4dQuickFixUnavailable: "The ability to fix violations with 'Agentforce for Developers' is unavailable since a compatible 'Agentforce for Developers' extension was not found or activated. To enable this functionality, please install the 'Agentforce for Developers' extension and restart VS Code.",
18
-
failedA4DResponse: "Unable to receive code fix suggestion from Agentforce for Developers."
17
+
a4dQuickFixUnavailable: "The ability to fix violations with 'Agentforce Vibes' is unavailable since a compatible 'Agentforce Vibes' extension was not found or activated. To enable this functionality, please install the 'Agentforce Vibes' extension and restart VS Code.",
18
+
a4dQuickFixUnauthenticatedOrg: "The ability to fix violations with 'Agentforce Vibes' is unavailable since you are not authenticated to an org. To enable this functionality, please authenticate to an org.",
19
+
failedA4DResponse: "Unable to receive code fix suggestion from Agentforce Vibes."
19
20
},
20
21
unifiedDiff: {
21
22
mustAcceptOrRejectDiffFirst: "You must accept or reject all changes before performing this action.",
it('When llm response has extra text before JSON (like "apist"), then fix is suggested successfully',async()=>{
206
+
spyLLMService.callLLMReturnValue='apist\n{\n "explanation": "Added ApexDoc comment to the class",\n "fixedCode": "/**\\n * This class demonstrates bad practices.\\n */\\npublic class Test {}"\n}';
expect(display.displayInfoCallHistory[0].msg).toEqual('Fix Explanation: test explanation');
225
+
});
226
+
227
+
it('When llm response is JSON wrapped in single quotes and markdown, then fix is suggested successfully',async()=>{
228
+
constcomplexResponse=`' \`\`\`json{ "explanation": "Added ApexDoc comment to the class to satisfy the ApexDoc rule requirement for public classes.", "fixedCode": "/**\\\\n * This class demonstrates bad cryptographic practices.\\\\n */\\\\npublic without sharing class ApexBadCrypto {\\\\n Blob hardCodedIV = Blob.valueOf('Hardcoded IV 123');\\\\n Blob hardCodedKey = Blob.valueOf('0000000000000000');\\\\n Blob data = Blob.valueOf('Data to be encrypted');\\\\n Blob encrypted = Crypto.encrypt('AES128', hardCodedKey, hardCodedIV, data);\\\\n}"}\`\`\`'`;
expect(display.displayInfoCallHistory[0].msg).toEqual('Fix Explanation: Added ApexDoc comment to the class to satisfy the ApexDoc rule requirement for public classes.');
237
+
});
238
+
239
+
it('When llm response has leading whitespace and newlines, then fix is suggested successfully',async()=>{
0 commit comments