You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Broken out from #7. @Mythra maintains a list of detailed descriptions for error codes for a project they are working on. These include error codes for Starlark errors. It would be great if Starlark could provide and integrate them, at low cost. The rough plan is:
Each enum variant in our error enums becomes a named error code, e.g. ValueError::IntegerOverflow might get the code STARLARK::INTEGER_OVERFLOW. For Lint errors we convert the enum into a code in a similar manner, so that code/approach can be reused.
We show those codes in the Diagnostic type, either optionally or always (we'll see how messy they make things, but probably always).
@Mythra provides a markdown file with more information on each code. One potential format would be a single error_codes.md file with section headings ## STARLARK::INTEGER_OVERFLOW followed by arbitrary markdown content about the error.
The Starlark library uses include_str!() to make that available, as a .describe(&self) method on Diagnostic, and also as a Diagnostic::describe_code(&str) method to enable implementing --describe=INTEGER_OVERFLOW on the command line.
While the steps are in logical order, in truth writing the Markdown file is the biggest effort by a huge margin, so that will probably come first - the actual technical tweaks are probably an hour in total, so I'll happily do them once a somewhat complete Markdown file arrives.
The text was updated successfully, but these errors were encountered:
Broken out from #7. @Mythra maintains a list of detailed descriptions for error codes for a project they are working on. These include error codes for Starlark errors. It would be great if Starlark could provide and integrate them, at low cost. The rough plan is:
enum
variant in our error enums becomes a named error code, e.g.ValueError::IntegerOverflow
might get the codeSTARLARK::INTEGER_OVERFLOW
. For Lint errors we convert the enum into a code in a similar manner, so that code/approach can be reused.Diagnostic
type, either optionally or always (we'll see how messy they make things, but probably always).error_codes.md
file with section headings## STARLARK::INTEGER_OVERFLOW
followed by arbitrary markdown content about the error.include_str!()
to make that available, as a.describe(&self)
method onDiagnostic
, and also as aDiagnostic::describe_code(&str)
method to enable implementing--describe=INTEGER_OVERFLOW
on the command line.While the steps are in logical order, in truth writing the Markdown file is the biggest effort by a huge margin, so that will probably come first - the actual technical tweaks are probably an hour in total, so I'll happily do them once a somewhat complete Markdown file arrives.
The text was updated successfully, but these errors were encountered: