-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Fix completions bug in Kite introduced by PR 10605 #10630
Conversation
I'm currently trying to add a test that mocks the completions response in various ways. |
That sounds very nice, thanks! However, we'd prefer integration tests, so if you could add tests that call Kite directly, that would be much better. |
Hello @metalogical! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-11-07 17:58:33 UTC |
@ccordoba12 I added a unit test (and fixtures) that allow mocking the completions responses, and verify that a simple dict key completion example with I agree that integration tests would be nice, but I'm not sure what the best approach to get that working is. We have a However, we'd need to set up a way to retrieve the this binary from the web or somewhere else. I think it's worth investing in (and we'd be willing to spend resources here whenever we have them), but would prefer to tackle this as a separate issue. |
# Set cursor to start | ||
code_editor.go_to_line(1) | ||
|
||
qtbot.keyClicks(code_editor, 'my_dict.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the .
at end of my_dict
is necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I use this test case is because this is a type of completion that Kite returns (it allows users to quickly access dict keys with a .
), and it's a case where the completion ["dict-key"]
replacing the .
can't be represented with just insertText
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I didn't know that and it's pretty cool!
Thanks for the look-over @ccordoba12 I addressed your comments. |
Just for the record, a contributor is migrating pyls completions to use textEdit: palantir/python-language-server#690 |
@andfoy interesting Note that currently Spyder's support for If EDIT: on further investigation, that PR doesn't remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now. Thanks @metalogical!
Description of Changes
Fixes exception raised due to #10605 (described here)
How can we make sure we don't regress again? Maybe we need fixturized test cases with sample completions dicts that we return to the completions logic and ensure it works properly with
textEdit
s. Thoughts?Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: @metalogical