Skip to content

Commit

Permalink
throw TypeError when creating diagnostic without range or without mes…
Browse files Browse the repository at this point in the history
…sage, fixes #99410
  • Loading branch information
jrieken committed Aug 12, 2020
1 parent c17b4c2 commit c67a82d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vs/workbench/api/common/extHostTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,12 @@ export class Diagnostic {
tags?: DiagnosticTag[];

constructor(range: Range, message: string, severity: DiagnosticSeverity = DiagnosticSeverity.Error) {
if (!Range.isRange(range)) {
throw new TypeError('range must be set');
}
if (!message) {
throw new TypeError('message must be set');
}
this.range = range;
this.message = message;
this.severity = severity;
Expand Down

0 comments on commit c67a82d

Please sign in to comment.