提交 c67a82da 编写于 作者: J Johannes Rieken

throw TypeError when creating diagnostic without range or without message,...

throw TypeError when creating diagnostic without range or without message, fixes https://github.com/microsoft/vscode/issues/99410
上级 c17b4c24
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册