Skip to content
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

Syntax error line numbers #59

Closed
georules opened this issue Oct 13, 2015 · 8 comments · Fixed by #70
Closed

Syntax error line numbers #59

georules opened this issue Oct 13, 2015 · 8 comments · Fixed by #70

Comments

@georules
Copy link
Contributor

screen shot 2015-10-13 at 3 35 43 pm

It's hard to find where your error is because the code loaded in from the blob doesn't have a map to the line number you are working on in the editor.

@enjalot
Copy link
Owner

enjalot commented Oct 13, 2015

yeah, this is because I'm inserting code before the user's code in the
iframe. We could count the lines and offset the line number given... but
can we intercept iframe errors?

We could probably add a onerror to the window inside the iframe code. it
could then postMessage the error and its metadata to the parent frame which
could then add widgets to the codemirror like we did in tributary

On Tue, Oct 13, 2015 at 12:36 PM, Geoffery Miller notifications@github.com
wrote:

[image: screen shot 2015-10-13 at 3 35 43 pm]
https://cloud.githubusercontent.com/assets/775628/10466063/22e6b550-71c0-11e5-8715-7932d7d57cf7.png

It's hard to find where your error is because the code loaded in from the
blob doesn't have a map to the line number you are working on in the editor.


Reply to this email directly or view it on GitHub
#59.

Ian Johnson - 周彦
http://enja.org

@georules
Copy link
Contributor Author

I'll dig into it, thanks for the leads to investigate.

@georules
Copy link
Contributor Author

@georules
Copy link
Contributor Author

Attaching a handler to iframe https://github.com/enjalot/building-blocks/blob/master/public/js/components/renderer.js#L71 did not seem to fire for me. I tried iframe.contentWindow as well, but it did not fire (no complaining about any iframe sandbox security either)

@enjalot
Copy link
Owner

enjalot commented Oct 15, 2015

yeah, from what I can tell you can only listen to the errors from within
the iframe

On Thu, Oct 15, 2015 at 11:33 AM, Geoffery Miller notifications@github.com
wrote:

Attaching a handler to iframe
https://github.com/enjalot/building-blocks/blob/master/public/js/components/renderer.js#L71
did not seem to fire for me. I tried iframe.contentWindow as well, but it
did not fire (no complaining about any iframe sandbox security either)


Reply to this email directly or view it on GitHub
#59 (comment)
.

Ian Johnson - 周彦
http://enja.org

@georules
Copy link
Contributor Author

I wanted to share a prototype of this, to ask what you think about the method of implementation. The styling needs a lot of work.

georules@6662894

https://youtu.be/8zfiCufLnHg

@enjalot
Copy link
Owner

enjalot commented Oct 18, 2015

this is great work! looks awesome so far. I shared a couple of comments in
the commit for things that I think could be improved, but I think the
fundamental approach is correct. 💯

On Sun, Oct 18, 2015 at 10:01 AM, Geoffery Miller notifications@github.com
wrote:

I wanted to share a prototype of this, to ask what you think about the
method of implementation. The styling needs a lot of work.

georules/building-blocks@6662894
georules@6662894

https://youtu.be/8zfiCufLnHg


Reply to this email directly or view it on GitHub
#59 (comment)
.

Ian Johnson - 周彦
http://enja.org

@georules
Copy link
Contributor Author

The tooltip has some visual problems, I'm not sure why more than one is being created. I attempted to specify which ReactTooltip to use with data-for and id's as suggested in the docs when you have more than one, but that didn't seem to help.
screen shot 2015-10-19 at 8 58 18 am

The version of react-tooltip we have is fairly old, I'm not sure if that's an issue. I tried updating it, but it complained about a react peer dependency -- when I updated it it broke everything 😢

I'm a bit new to React, and I think I'm struggling because codemirror is not a react component, and I'm trying to put react components into it. I tried a few ways -- one way by inserting an element with data-tip into an innerHTML, but then you have to mouse over a different ReactTooltip before it will work (I think because it's not firing some kind of update/render for react when manually inserting innerHTML)
georules@28bf330#diff-54d7292f8a4b40b43aa9fad1c622303dR90

I also tried creating my own component class, but that's causing tons of components to be readded rather than reused.
georules@19b8aff#diff-54d7292f8a4b40b43aa9fad1c622303dR97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants