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

Autoparens appear when autocompleting in the import section #2581

Closed
goanpeca opened this issue Aug 2, 2015 · 7 comments
Closed

Autoparens appear when autocompleting in the import section #2581

goanpeca opened this issue Aug 2, 2015 · 7 comments

Comments

@goanpeca
Copy link
Member

goanpeca commented Aug 2, 2015

Autoparens is a great addition, but it should not be applied everywhere, such as whem importing something....

For example if I have this and then press Tab in this case (* denotes cursor location)

from spyderlib.qt.QtGui import QToolButton, QToolT*

We get

from spyderlib.qt.QtGui import QToolButton, QToolTip()

Which is not very helpful....

Any thoughts @blink1073?

@goanpeca goanpeca added this to the v3.0 milestone Aug 2, 2015
@blink1073
Copy link
Contributor

Hmm, that's a tricky one. What if we only apply it if there is an = sign in the line?

@goanpeca
Copy link
Member Author

goanpeca commented Aug 2, 2015

I would rather make some helper function in the order of...

is_import_statement()

So you would know you are inside an import statement..?

@goanpeca
Copy link
Member Author

goanpeca commented Aug 2, 2015

This would be very useful for other cases, like auto formatting import statements

@blink1073
Copy link
Contributor

I'm not sure how to do that for import continuation lines like:

from IPython import (
   blah, blah2, blah3

@goanpeca
Copy link
Member Author

goanpeca commented Aug 2, 2015

can we do a lookup of the import word in the previous lines?

@blink1073
Copy link
Contributor

Oh, duh, we're already checking for imports, this is actually simple then.


Sent from Mailbox

On Sun, Aug 2, 2015 at 6:37 PM, Gonzalo Peña-Castellanos
[email protected] wrote:

can we do a lookup of the import word in the previous lines?

Reply to this email directly or view it on GitHub:
#2581 (comment)

@goanpeca
Copy link
Member Author

goanpeca commented Aug 3, 2015

👍

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

No branches or pull requests

3 participants