protected override void Print(LSP.Diagnostic m) { if (ErrorCodesToIgnore.Any(code => m.Code == QsCompiler.CompilationBuilder.Errors.Code(code))) { return; } Logger?.Log(MapLevel(m.Severity), $"{m.Code}: {m.Message}"); Logs.Add(m); }
/// <summary> /// Initializes a new diagnostic. /// If a diagnostic generated by the Q# compiler is given as argument, the values are initialized accordingly. /// </summary> public static Diagnostic Create(VS.Diagnostic d = null, Stage stage = Stage.Unknown) => d == null ? new Diagnostic() : new Diagnostic
protected internal virtual string Format(Diagnostic msg) => this.applyFormatting(msg);
protected sealed override void Print(Diagnostic msg) => PrintToConsole(msg.Severity, this.Format(msg));
protected override void Print(LSP.Diagnostic m) { Logger?.Log(MapLevel(m.Severity), $"{m.Code}: {m.Message}"); Logs.Add(m); }