private Diagnostic AsDiagnostic(TypeCobol.Compiler.Diagnostics.Diagnostic d) { var diagnostic = new Diagnostic(); diagnostic.Range.Start.Character = d.ColumnStart; diagnostic.Range.End.Character = d.ColumnEnd; diagnostic.Severity = (int)d.Info.Severity; diagnostic.Code = d.Info.Code.ToString(); diagnostic.Source = d.Info.Document.Id.ToString(); diagnostic.Message = d.Message; return diagnostic; }
private void writeMessage(string id, Diagnostic error) { writer.WriteStartElement("MESSAGE"); writer.WriteElementString("MSGNUMBER", "TC-" + error.Code.PadLeft(5, '0') + AsIBMSuffix(error.Severity)); writer.WriteElementString("MSGLINE", error.Range.End.Line.ToString()); writer.WriteElementString("MSGFILE", id); writer.WriteElementString("MSGTEXT", error.Message); writer.WriteEndElement();// MESSAGE }