-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement source maps support to locate JavaScript errors in code blocks #93
Comments
👍 |
The line numbers would be nice to have but I won't spend time on this before 1.0.0. Patches welcome. |
I realize this in #225. |
I don't think so. This issue is about JavaScript syntax errors in actions/predicates/initializer. These currently cause This was somewhat more important in the past (when this issue was reported) because |
👍 |
I hit this for the first time yesterday. It was rough sorting out how to fix it, and the error I got, while correct, was deeply counter-intuitive. I had intended to write Strictly speaking that's correct, but I went off on a fruitless search for aberrant close-braces. I ended up finding it with a differ With a line number, this would have been trivial. Pls halp ❤️ |
I'll look into this after 0.11, but as I haven't done much with source maps before (which is the only way to track error's like this), I can't guarantee a date or version. In the meantime, if anyone is inclined to, they're welcome to send a PR for this 😄 |
Yes! I just started working with source maps since they are broken in LiveScript. And now I'm missing them in pegjs 😄 A popular lib for implementation: https://github.com/mozilla/source-map and a tutorial: https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/ Here is a nice tool to help during development: http://sokra.github.io/source-map-visualization/ |
👍 Would want source maps not just for stacktrace, but also debugging in, say, vs code or chrome dev tools...since I write my initialization logic separately (in another file) and concat them before parser build. |
I like the idea of sourcemaps. While we wait, if you actually need them, there's an easy way to get them: parse your handlers in something that does sourcemaps, like That's super ugly and hacky, but it's also durable and something you can do in an hour until this is done properly Also, I'm looking at my 2017 comment, and I realize in retrospect that for what I was doing, there was a much easier solution: the handlers should have been enforcing the things I was trying to trace with exceptions. I was just not javascripting effectively at that time. I have no idea how sourcemaps actually work, so I have no opinions on proper implementation. dmajda was wrong to cite The library has needs, the userbase has needs, and we're more interested in our personal intent than solving those needs. That's why in 2020 the Because two maintainers "didn't want the code." It's time for a maintainer that does want the code |
For example:
The text was updated successfully, but these errors were encountered: