Skip to content

Super errors broke vscode tasks problem matchers #3446

@jchavarri

Description

@jchavarri

The project themes included in bsb contain some VSCode tasks with problem matchers. For example, in basic-reason theme:

https://github.com/BuckleScript/bucklescript/blob/3cf3133a4978df05e0b5fb351a1d2d18dce16c32/jscomp/bsb/templates/basic-reason/.vscode/tasks.json#L24-L39

These matchers used to work fine in the past, when bsb was showing OCaml-like errors like:

File "lib/Util.re", line 4, characters 25-26:
Error: This expression has type int but an expression was expected of type
         string

but they break with super error format. This format is nicer for console errors, but really hard to parse from another program through regexps (see ocaml-lang-server handling as an example).

Would there be a way to pass an extra flag to bsb (even if it's only in watch mode) that would skip super errors and output the errors in the old format?

Adding this flag would be really useful to simplify the logic and responsibilities that Reason / OCaml vscode extensions need to do right now.
Also, going back to the OCaml format would be a big step to come up with problem matchers that can be shared between BuckleScript and Dune (for native projects). While in Dune the users have much more control (just don't use refmterr) in BuckleScript that's not the case.

Note: There is a separate issue in vscode, where problem matchers can't parse error messages in multiple lines (see microsoft/vscode#9635). This is another problem that is unrelated to the fact that super errors broke all errors parsed by the problem matcher provided by bsb themes, multiline or not.

cc @chenglou

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions