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

Hydrogen run not working properly for multiline definitions in python #1344

Closed
mlangiu opened this issue Jun 21, 2018 · 10 comments
Closed

Hydrogen run not working properly for multiline definitions in python #1344

mlangiu opened this issue Jun 21, 2018 · 10 comments

Comments

@mlangiu
Copy link

mlangiu commented Jun 21, 2018

Description:
When defining a function that has a long name or many arguments, such that you may want to split it into multiple lines for better readability, Hydrogen Run appears to work incorrectly.
This may be related to #1341

Steps to Reproduce:

When writing a long function such as below, the Hydrogen Run command fails:
grafik
With the error:

IndentationError: expected an indented block
  File "<ipython-input-38-872b2e2fcfdd>", line 3
    """Do amazing things."""

We need to add several indents to make this work:
grafik

Versions:

OS: Win 10 Enterprise
Atom : 1.27.2
Electron: 1.7.15
Chrome : 58.0.3029.110
Node : 7.9.0

@BenRussert
Copy link
Member

Hi, does the first format work if you run it as a script? python my-filename.py from the cli.

@kylebarron
Copy link
Contributor

@mlangiu This works fine for me in Hydrogen. Just make sure your cursor is on the line with def.

image

@mlangiu
Copy link
Author

mlangiu commented Jul 26, 2018

@BenRussert Yes, that works
@kylebarron For me it doesn't work no matter where the cursor is, not even when selecting the entire function and then executing Hydrogen Run (as in the if/else statement in #1341). Could you let us know your version information?

@kylebarron
Copy link
Contributor

Oh wait, @mlangiu , you must be using the hydrogen-python extension?

This is an open issue I raised back in March and has nothing to do with Hydrogen proper. nikitakit/hydrogen-python#3

@mlangiu
Copy link
Author

mlangiu commented Jul 27, 2018

Indeed I am!

@kylebarron
Copy link
Contributor

There are some bugs with that extension. I recommend you turn it off/disable it until some bugs have been fixed.

@mlangiu
Copy link
Author

mlangiu commented Jul 27, 2018

I did, thanks for the info

@kylebarron
Copy link
Contributor

Hydrogen-python has been updated and should handle this situation correctly. Open an issue there if you still have issues.

@garciadias
Copy link

Hydrogen-python has been updated and should handle this situation correctly. Open an issue there if you still have issues.

I am not using the extension and it is not working in 2.16.3 version. Is it possible that something broke it in the latest updates?
Thank you.

@ddcgchow94
Copy link

I got the same error. using hydrogen 2.16.3 without the extension

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

5 participants