Skip to content

Commit c67a82d

Browse files
committed
throw TypeError when creating diagnostic without range or without message, fixes microsoft#99410
1 parent c17b4c2 commit c67a82d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,12 @@ export class Diagnostic {
885885
tags?: DiagnosticTag[];
886886

887887
constructor(range: Range, message: string, severity: DiagnosticSeverity = DiagnosticSeverity.Error) {
888+
if (!Range.isRange(range)) {
889+
throw new TypeError('range must be set');
890+
}
891+
if (!message) {
892+
throw new TypeError('message must be set');
893+
}
888894
this.range = range;
889895
this.message = message;
890896
this.severity = severity;

0 commit comments

Comments
 (0)