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

Add code actions to add/remove/sort imports #86

Open
tomv564 opened this issue Aug 7, 2017 · 6 comments
Open

Add code actions to add/remove/sort imports #86

tomv564 opened this issue Aug 7, 2017 · 6 comments

Comments

@tomv564
Copy link
Contributor

tomv564 commented Aug 7, 2017

A sort imports action could always be available.
An add/remove import action could be registered for locations where pyflakes complained about missing/unused imports.

See: https://github.com/alecthomas/importmagic for a library supporting this functionality.

@gatesn
Copy link
Contributor

gatesn commented Aug 21, 2017

Feel free to steal and build off https://github.com/palantir/python-language-server/tree/ngates/auto-import if you have time.

It's a little too rough right now. Ideally we would want import magic to report the position it found the unimported modules instead of searching for them :/

@gatesn gatesn mentioned this issue Aug 24, 2017
@ghost
Copy link

ghost commented Aug 24, 2017

+1, import magic and isort combo would be amazing. I would probably leave isort as a separate manual command (same as YAPF).

@ghost
Copy link

ghost commented Aug 24, 2017

To clarify, having a separate isort command would allow the user to clean the imports manually, not only when new ones are added automatically.

@ghost
Copy link

ghost commented Aug 4, 2018

+1 for including importmagic! There are atom and vscode implementations already, guess it should be easy?

@zewa666
Copy link

zewa666 commented Sep 20, 2019

any updates on this one?

@youben11
Copy link
Contributor

@zewa666 implemented in #685. You can start testing if you'd like and report any issue that may arise.

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

4 participants