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

Fix autoimport raising AttributeError in some cases #309

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

douo
Copy link
Contributor

@douo douo commented Nov 29, 2022

More detail in #307

Fixes #307

@ccordoba12 ccordoba12 added this to the v1.7.0 milestone Nov 29, 2022
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @douo! To fix the linting error reported by Github actions, please add the following inline comment next to the definition of _should_insert:

def _should_insert(expr: tree.BaseNode, word_node: tree.Leaf) -> bool:  # pylint: disable=too-many-return-statements

Otherwise looks good to me.

@ccordoba12 ccordoba12 changed the title Fix #307 autoimport raise AttributeError in some case. Fix autoimport raising AttributeError in some cases Nov 29, 2022
@douo
Copy link
Contributor Author

douo commented Nov 30, 2022

Done, Thanks @ccordoba12.

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply the suggestion I left below to please another of our linters.

test/plugins/test_autoimport.py Show resolved Hide resolved
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your help @douo! We really appreciate it.

@ccordoba12 ccordoba12 merged commit 789c2a6 into python-lsp:develop Nov 30, 2022
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 this pull request may close these issues.

Autoimport keep throwing exception when delete a line
2 participants