Skip to content

Commit

Permalink
Support 'information' diagnostic severity
Browse files Browse the repository at this point in the history
Fixes #5762

- add support for `information` diagnostic severity.
- populate the `problems-view` with `info` markers.
- add a statusbar icon for `problems` to reflect `info` markers if present

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed Jul 24, 2019
1 parent 8114667 commit 22ef59c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/markers/src/browser/problem/problem-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export class ProblemContribution extends AbstractViewContribution<ProblemWidget>

protected setStatusBarElement(problemStat: ProblemStat) {
this.statusBar.setElement('problem-marker-status', {
text: `$(times-circle) ${problemStat.errors} $(exclamation-triangle) ${problemStat.warnings}`,
text: problemStat.infos <= 0
? `$(times-circle) ${problemStat.errors} $(exclamation-triangle) ${problemStat.warnings}`
: `$(times-circle) ${problemStat.errors} $(exclamation-triangle) ${problemStat.warnings} $(info-circle) ${problemStat.infos}`,
alignment: StatusBarAlignment.LEFT,
priority: 10,
command: this.toggleCommand ? this.toggleCommand.id : undefined
Expand Down
4 changes: 3 additions & 1 deletion packages/markers/src/browser/problem/problem-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Diagnostic } from 'vscode-languageserver-types';
export interface ProblemStat {
errors: number;
warnings: number;
infos: number;
}

@injectable()
Expand All @@ -41,8 +42,9 @@ export class ProblemManager extends MarkerManager<Diagnostic> {

const errors = allMarkers.filter(m => m.data.severity === 1).length;
const warnings = allMarkers.filter(m => m.data.severity === 2).length;
const infos = allMarkers.filter(m => m.data.severity === 3).length;

return { errors, warnings };
return { errors, warnings, infos };
}

}

0 comments on commit 22ef59c

Please sign in to comment.