-
Notifications
You must be signed in to change notification settings - Fork 766
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] Remove unloaded_buffer parameter #542
Conversation
Current coverage is 93.62% (diff: 100%)@@ master #542 diff @@
==========================================
Files 41 41
Lines 3856 3856
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 3606 3610 +4
+ Misses 250 246 -4
Partials 0 0
|
That was my thought when i saw the ycmd issue :) Don't suppose there's any way we can make a simple test for this? I guess the only real way would be to mock out Reviewed 1 of 1 files at r1. Comments from Reviewable |
although like @puremourning, I'd like to see some sort of test. Not necessarily in this PR. Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed. Comments from Reviewable |
I'd also like to add a test for this. I think the best way would be to find an example that fails without this change where we open two files in TSServer, close one of them, and ask for completions in the other. I tried to find such example but was not successful. At this point, I even wonder if closing a file in TSServer is doing anything. Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed. Comments from Reviewable |
f5f2c67
to
e7af3c5
Compare
I gave some thoughts to the So, what do you think? Should we drop the parameter in this PR or merge it in current state and open a new PR for that? Reviewed 1 of 1 files at r1, 1 of 1 files at r2, 3 of 3 files at r3. Comments from Reviewable |
That's certainly a good point. I wonder what the other client maintainers think... Does the Vim client even send this parameter as anything other than the current file? Review status: all files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
In Emacs we send the current file in the |
YCM send this parameter as the unloaded buffer path.
Would it be an issue to send the unloaded/closed buffer instead in the Emacs client? Review status: all files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
That is the case. The current file is the one which is closed. So basically in Emacs the file for |
Thanks. I've looked at the Atom client and it seems to do the same as the Emacs client. The Sublime client is not implementing the In conclusion, only the Vim client is affected by the issue I mentioned above (shame on us). So, we should first fix the bug in YCM by sending the request as the unloaded buffer instead of the current one for the Review status: all files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Yes. So Atom client won't be affected. Review status: all files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
57a0110
to
e331832
Compare
[READY] Use deleted buffer instead of current buffer when sending BufferUnload event notification When deleting a buffer, we use the current buffer to send the `BufferUnload` event notification request to ycmd instead of the buffer being deleted. This is an issue when the current buffer is not of the same filetype as the deleted one. In this case, three different scenarios may occur: - the current buffer filetype is not allowed: no request is sent to the ycmd server. The `OnBufferUnload` method from the completer corresponding to the filetype of the deleted buffer is not called. If the filetype is a C-family language, the translation unit is not destroyed. If it is TypeScript, we don't tell TSServer to close the file (not really an issue unless the file is modified elsewhere); - the current buffer filetype has no semantic support in ycmd: the request is sent to the ycmd server but no semantic completer is used. Same result; - the current buffer filetype has semantic support in ycmd: the `OnBufferUnload` method from the wrong completer is called in ycmd. LibClang and TSServer are able to cope with that and ignore the file. Same result in definitive. The solution is obvious: build the request for the deleted buffer in this case. However, this involves more changes than expected because the code was written with the assumption that requests are always for the current buffer. The `include_buffer_data` parameter from `BuildRequestData` was removed as it is always used with its default value. This fix may alleviate issue #2232 in the sense that it now gives a reliable way to limit memory usage by deleting buffers in the case of multiple TUs. Next step is to update PR ycm-core/ycmd#542 by removing the `unloaded_buffer` parameter from ycmd API then remove it from the `BufferUnload` request in YCM. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2367) <!-- Reviewable:end -->
e331832
to
fc9eca3
Compare
a4d394f
to
8f9219c
Compare
I updated the PR by completely removing the PR is now ready. Reviewed 1 of 5 files at r4, 3 of 3 files at r5, 3 of 3 files at r7, 1 of 1 files at r8. Comments from Reviewable |
8f9219c
to
210360f
Compare
Review status: 3 of 4 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
I am a little puzzled by the title of the PR and the code of the PR so, we were already closing the right buffer in the Typescript completer? @micbou the code so if is only a matter of an "old" title feel free to fire Review status: 3 of 4 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
Reviewed 1 of 5 files at r4, 2 of 3 files at r7, 1 of 1 files at r9. Comments from Reviewable |
I forgot to update the title of the PR. Sorry for the confusion. @homu r=vheon Reviewed 1 of 1 files at r9. Comments from Reviewable |
📌 Commit 210360f has been approved by |
[READY] Remove unloaded_buffer parameter Closes #541. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/542) <!-- Reviewable:end -->
💔 Test failed - status |
210360f
to
4db361f
Compare
Remove unloaded_buffer parameter from BufferUnload event notification request.
4db361f
to
ba85bed
Compare
@homu retry |
@homu r+ |
📌 Commit ba85bed has been approved by |
[READY] Remove unloaded_buffer parameter Closes #541. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/542) <!-- Reviewable:end -->
There is an issue with the TypeScript tests on Linux Travis. I'm on it. |
💔 Test failed - status |
@homu retry |
[READY] Remove unloaded_buffer parameter Closes #541. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/542) <!-- Reviewable:end -->
☀️ Test successful - status |
[READY] Remove unloaded_buffer parameter See PR ycm-core/ycmd#542. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2407) <!-- Reviewable:end -->
Closes #541.
This change is