apache / incubator-kie-issues

Apache License 2.0
11 stars 1 forks source link

Add source mapping support for the JIT-Executor validation results #1224

Open Josephblt opened 1 month ago

Josephblt commented 1 month ago

To make full use of the Diagnostics feature provided by the VS Code API, the JIT-Executor validation results should be able to provide source mapping information for (i.e. line, column) for elements.

For example:

Original:

{
  "severity": "ERROR",
  "message": "Overlapping rules have different output value, so the HitPolicy for decision table 'Preapproval' should be PRIORITY",
  "messageType": "DECISION_TABLE_HITPOLICY_RECOMMENDER",
  "sourceId": "_E7994A2B-1189-4BE5-9382-891D48E87D47",
  "level": "ERROR"
}

Proposed change:

{
  "severity": "ERROR",
  "message": "Overlapping rules have different output value, so the HitPolicy for decision table 'Preapproval' should be PRIORITY",
  "messageType": "DECISION_TABLE_HITPOLICY_RECOMMENDER",
  "sourceId": "_E7994A2B-1189-4BE5-9382-891D48E87D47",
  "sourceMap": {
    "line": 10,
    "column": 34
  },
  "level": "ERROR"
}
tiagobento commented 6 days ago

The only way to make the error messages useful on VS Code is through line/column coordinates? What if my file is binary, and a custom editor? I mean... isn't it possible to use the sourceId to do this mapping? Of course, if we had this, when opening the DMN and BPMN files as text to edit the XML manually, it would be useful, but when using our diagram editors... not so much, no?