diff --git a/src/editor/executor.ts b/src/editor/executor.ts index c4a8ef4..0abaa42 100644 --- a/src/editor/executor.ts +++ b/src/editor/executor.ts @@ -112,9 +112,11 @@ export class ExecutorAlerts { case ProcessStatusType.errored: this.statusBarItem.text = '$(testing-error-icon) CodeChecker: analysis errored'; + const logLocation = status.reason ? 'sidebar' : 'output log'; + Editor.notificationHandler.showNotification( NotificationType.error, - 'CodeChecker finished with error - see logs for details' + `CodeChecker finished with error - see the ${logLocation} for details` ); break; default: diff --git a/src/editor/notifications.ts b/src/editor/notifications.ts index 0d370e8..2c7dbb5 100644 --- a/src/editor/notifications.ts +++ b/src/editor/notifications.ts @@ -99,6 +99,22 @@ export class NotificationHandler { }; }; + const makeReason = (): (Command)[] => { + if (!status.reason) { + return []; + } + + return [{ + title: `Reason: ${status.reason}`, + command: 'codechecker.executor.showOutput', + tooltip: `Reason: ${status.reason}\nSee the output log for full details` + }, + { + title: 'Show process logs', + command: 'codechecker.executor.showOutput' + }]; + }; + switch (status.type) { case ProcessStatusType.queued: { const newNotification = SidebarContainer.notificationView.addNotification( @@ -148,7 +164,16 @@ export class NotificationHandler { case ProcessStatusType.finished: { notification!.update({ message: makeMessage('finished running'), - choices: [] + choices: makeReason() + }); + this.activeNotifications.delete(process.commandLine); + + break; + } + case ProcessStatusType.warning: { + notification!.update({ + message: makeMessage('finished with warnings'), + choices: makeReason() }); this.activeNotifications.delete(process.commandLine); @@ -157,10 +182,7 @@ export class NotificationHandler { case ProcessStatusType.errored: { notification!.update({ message: makeMessage('finished with errors'), - choices: [{ - title: 'Show process logs', - command: 'codechecker.executor.showOutput' - }] + choices: makeReason() }); this.activeNotifications.delete(process.commandLine);