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

Similar bug sending to ipython #3

Open
kylebarron opened this issue Mar 6, 2018 · 4 comments
Open

Similar bug sending to ipython #3

kylebarron opened this issue Mar 6, 2018 · 4 comments

Comments

@kylebarron
Copy link

image

@kylebarron
Copy link
Author

Some unit tests would probably help with this, but I don't know how to set that up.

@nikitakit
Copy link
Owner

Huh, this is actually quite a tricky case.

Looks like I may have to re-evaluate my approach, and maybe even remove the indentation-fixing functionality from hydrogen-python until I can write some entirely new code for this.

I don't want to get too much into the details here, but you can see my second-to-last comment on nteract/hydrogen#862. This bug relates to a fundamental limitation of hydrogen. I thought I could use some simple heuristics to work around this, but looks like that approach is fundamentally flawed.

@kylebarron
Copy link
Author

Just checking... I assume it's impossible to deal with common leading whitespace in Python specifically by using Python's dedent function? Because Hydrogen has already stripped the text before passing it to Python, right?

@nikitakit
Copy link
Owner

That's right.

It looks like the best way to solve this issue is to retrieve the original text (e.g. using Atom's APIs) and recover the unstripped version of the text. This has been on my TODO list for a while now, but I haven't gotten around to implementing it.

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

No branches or pull requests

2 participants