Skip to content

Commit

Permalink
Add settings to disable CodeChecker version notifs
Browse files Browse the repository at this point in the history
  • Loading branch information
Discookie committed Jul 15, 2022
1 parent 4571084 commit 961ff85
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
"description": "Enable CodeLens for displaying the reproduction path",
"default": true
},
"codechecker.executor.enableVersionCheckNotifications": {
"type": "boolean",
"description": "Enable notifications when CodeChecker is not found or not supported",
"default": true
},
"codechecker.executor.runOnSave": {
"type": "boolean",
"description": "Controls auto-run of CodeChecker on save",
Expand Down
16 changes: 10 additions & 6 deletions src/backend/executor/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ export class ExecutorBridge implements Disposable {
}

this.versionCheckInProgress = true;
const shouldShowWarning = workspace.getConfiguration('codechecker.executor')
.get<boolean>('enableVersionCheckNotifications');

const ccPath = getConfigAndReplaceVariables('codechecker.executor', 'executablePath') || 'CodeChecker';
const commandArgs = this.getVersionCmdArgs();
Expand Down Expand Up @@ -448,7 +450,7 @@ export class ExecutorBridge implements Disposable {

this.versionChecked = false;

if (!this.shownVersionWarning) {
if (shouldShowWarning && !this.shownVersionWarning) {
this.shownVersionWarning = true;
let choice;

Expand Down Expand Up @@ -494,7 +496,7 @@ export class ExecutorBridge implements Disposable {

this.versionChecked = true;

if (this.shownVersionWarning) {
if (shouldShowWarning && this.shownVersionWarning) {
this.shownVersionWarning = false;

window.showInformationMessage(
Expand All @@ -506,9 +508,11 @@ export class ExecutorBridge implements Disposable {
this._bridgeMessages.fire(`>>> Internal error while checking version: ${err}\n`);
this.versionChecked = false;

window.showErrorMessage(
'CodeChecker: Internal error while checking version - see logs for details'
);
if (shouldShowWarning) {
window.showErrorMessage(
'CodeChecker: Internal error while checking version - see logs for details'
);
}
}

break;
Expand All @@ -522,7 +526,7 @@ export class ExecutorBridge implements Disposable {
this._bridgeMessages.fire('>>> CodeChecker error while checking version\n');
this.versionChecked = false;

if (!this.shownVersionWarning) {
if (shouldShowWarning && !this.shownVersionWarning) {
this.shownVersionWarning = true;
let choice;

Expand Down
8 changes: 7 additions & 1 deletion src/editor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ export class ExecutorAlerts {
break;
case ProcessStatus.errored:
this.statusBarItem.text = '$(testing-error-icon) CodeChecker: analysis errored';
window.showErrorMessage('CodeChecker finished with error - see logs for details');

const shouldShowError = workspace.getConfiguration('codechecker.executor')
.get<boolean>('enableVersionCheckNotifications');

if (shouldShowError) {
window.showErrorMessage('CodeChecker finished with error - see logs for details');
}
break;
default:
break;
Expand Down

0 comments on commit 961ff85

Please sign in to comment.