sketch-sh
sketch-sh copied to clipboard
Display warnings in in the editor
Warnings aren't part of the compilation result, we need to teleport it out of console.log.
I have a reference implementation here for engine_native:
https://github.com/Sketch-sh/sketch-sh/blob/8de00e725b390c09cd3523e4ff92b7d0849f1f67/engine_native/src/repl/Execute.re#L6-L31
You'll need to translate that code into OCaml and hook it into jsoo_main.ml in sketch's bucklescript fork
I started looking into this and found some challenges, as the functions required to do this were not available back in 4.02.3:
Location.warning_printerwas introduced in 4.03: https://github.com/ocaml/ocaml/commit/f9ea209cb7dd08634917e332aba8c61962bc5168Warnings.reportwas added in 4.06: https://github.com/ocaml/ocaml/commit/356d8a9c0c3439848444ec5dab7250c72b77ceeb
@thangngoc89 considering this, do you think it's easier to find a way to do this with the utils available in 4.02.3? Or rather try to compile jsoo_main in the browser with the latest 4.06 version?
Or rather try to compile jsoo_main in the browser with the latest 4.06 version?
@jchavarri this isn't possible because bucklescript doesn't use opam switch's compiler-libs. I think there should be the same tools to do these things in ocaml 4.02.3
BuckleScript does not exist anymore and I don't think we will have the resources to build a brand new Sketch engine for ReScript anytime soon, so closing related issues.