onflow/cadence

Add more information to analysis.Diagnostic

jribbink opened this issue · 0 comments

Issue to be solved

Currently analysis.Diagnostic only contains information regarding:

  • Messaging
  • Fixes
  • Location
  • A black box "category" field

In order to provide more robust diagnostic information to users, it would be helpful to extend this struct and add the following

  • URL to documentation
  • An error code (needed by LSP to link to documentation & useful to categorize/identify diagnostics when looking for solutions, documentation, help, etc)
  • Severity field

While certain tooling (LS) does use the "Category" field to resolve a severity, it is somewhat limiting and there are benefits to a more generalized approach:

  • Analyzers cannot define severity on a per-diagnostic basis
  • Diagnostic categories are not necessarily standardized and it may not be entirely clear to the consumer which category maps to which severity level/which diagnostic categories exist

Suggested Solution

No response