pixelkind / p5canvas

An interactive preview for writing p5js code in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=garrit.p5canvas
Other
39 stars 4 forks source link

exposing javascript errors to the regular vs code output #41

Closed ccoenen closed 3 years ago

ccoenen commented 3 years ago

As reported in #40, currently JS errors will not be displayed anywhere.

First attempts at exposing a JavaScript error in the output-pane. It's not perfect, but it shows that it can be done. Hence the "WIP".

error output in output

ccoenen commented 3 years ago

even though the error object contains filename, row and column of the error, this info seems to be unusable, here:

grafik

It does not refer to the javascript file being run at all.

ccoenen commented 3 years ago

turns out, the linenumber is accurate, but since our code gets posted to an internal script tag, we need to remove a few lines from the counter. Now it looks like this:

grafik

ccoenen commented 3 years ago

I'm calling this "done" for now.