-
Notifications
You must be signed in to change notification settings - Fork 769
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
[READY] Use equality instead of identity when checking the status response in Rust completer #521
[READY] Use equality instead of identity when checking the status response in Rust completer #521
Conversation
Check that no error is raised and completions are empty when racerd returns a no content response.
I agree with this. Reviewed 2 of 2 files at r1. Comments from Reviewable |
Either edit the commit message to close #520 or remember to close it by hand 😃 |
Unfortunately, it doesn't fix the issue. In #520, racerd is crashing instead of returning a 204 no content response.
|
The user that opened the bug said that racerd didn't crash so I assumed that this was going to fix the bug on our hand but I should've read more carefully 😒 Review status: all files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
The real problem here was the lack of test coverage for the NO_CONTENT branch. Thanks for fixing this!
|
@homu r+ @Valloric You didn't give your opinion about using
|
📌 Commit e681335 has been approved by |
⚡ Test exempted - status |
…=micbou [READY] Use equality instead of identity when checking the status response in Rust completer `http.client.NO_CONTENT` is an enumeration member while `response.status_code` is an int so we need to use an equality instead of an identity. Added a test for when racerd returns a no content response. On a side note, I think we should use [`requests.codes` instead of `http.client`](http://docs.python-requests.org/en/master/user/quickstart/?highlight=status_code#response-status-codes) in these situations. This would prevent this kind of issue (`requests.codes.no_content` is an int) and we would not have to import the `http.client` module. If you agree, I'll send a PR replacing all `http.client` occurences. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/521) <!-- Reviewable:end -->
Sorry, missed that. I'm fine with it. |
http.client.NO_CONTENT
is an enumeration member whileresponse.status_code
is an int so we need to use an equality instead of an identity.Added a test for when racerd returns a no content response.
On a side note, I think we should use
requests.codes
instead ofhttp.client
in these situations. This would prevent this kind of issue (requests.codes.no_content
is an int) and we would not have to import thehttp.client
module. If you agree, I'll send a PR replacing allhttp.client
occurences.This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)