Skip to content

Commit

Permalink
FIX (Extension) @W-16476376@ Show Apex Guru summary on completion + r…
Browse files Browse the repository at this point in the history
…estrict Apex Guru commands to apex files (#117)
  • Loading branch information
jag-j committed Aug 15, 2024
1 parent f1ea764 commit b18dd7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
},
{
"command": "sfca.runApexGuruAnalysisOnSelectedFile",
"when": "sfca.apexGuruEnabled"
"when": "sfca.apexGuruEnabled && resourceExtname =~ /\\.cls|\\.trigger|\\.apex/"
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion src/apexguru/apex-guru-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export async function runApexGuruOnFile(selection: vscode.Uri, runInfo: RunInfo)
executedCommand: commandName,
duration: (Date.now() - startTime).toString()
});
void vscode.window.showInformationMessage(messages.apexGuru.finishedScan(ruleResult.violations.length));
});
} catch (e) {
const errMsg = e instanceof Error ? e.message : e as string;
Expand Down Expand Up @@ -172,4 +173,4 @@ export type ApexGuruReport = {
type: string;
value: string;
properties: ApexGuruProperty[];
}
}
3 changes: 2 additions & 1 deletion src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const messages = {
apexGuru: {
progress: {
message: "Code Analyzer running ApexGuru analysis."
}
},
finishedScan: (violationCount: number) => `Scan complete. ${violationCount} violations found.`
},
info: {
finishedScan: (scannedCount: number, badFileCount: number, violationCount: number) => `Scan complete. Analyzed ${scannedCount} files. ${violationCount} violations found in ${badFileCount} files.`
Expand Down

0 comments on commit b18dd7b

Please sign in to comment.