Skip to content

New diagnostics output format for CLI #1845

@fm-117

Description

@fm-117

Currently 2 formats are supported by CLI :

  • txt is the default format, it is designed for humans and describes diagnostics in plain strings
  • xml is an alternate format designed for RdZ (as a preprocessor format)

Those 2 formats do not contain all information as opposed to LSP format so the goal of this issue is to create a third format for CLI.

Here is a proposal, in XML:

<build return-code="ParsingDiagnostics">
  <filetable>
    <file index="1" path="C:\Users\UserName\Documents\cobol\test.tcbl" />
  </filetable>
  <diagnostics>
    <diagnostic file-index="1">
      <range line-start="4" column-start="20" line-end="4" column-end="23" />
      <message>Semantic error: Symbol var1 is not referenced</message>
      <info severity="Error" code="30" source="" />
    </diagnostic>
  </diagnostics>
</build>
  • it is a mix between current xml format and data from LSP diagnostic model
  • each diagnostic is associated to a file using a file-index attribute to support multifile parsing scenarios
  • all fields from LSP Diagnostic class are serialized
  • for quality rules violations, code is set to 47 and source will contain the rule identifier

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions