-
Notifications
You must be signed in to change notification settings - Fork 46
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
Ycmd completion unavailable while parsing is in progress #121
Comments
Well, semantic completion requests will fail, but identifier completion requests will succeed. Note that there have been recent changes in this area; ycmd used to allow several semantic completion requests for a single C++ file to proceed, but they would serialize on the TU mutex. For codebases with huge TUs (you might know one ;)), this would sometimes result in ycmd exhausting its threads. So since ycm-core/ycmd@c8aadd0, ycmd will only allow one C++ semantic completion request per file to proceed, while others that come in for the same file will get an HTTP error mentioning that the file is currently being parsed. This in no way affects identifier completion requests. Those always go in parallel and are super-fast. Note that YCM (the vim client) only sends semantic completion requests after semantic triggers (like |
@Valloric - oh, those are different requests? I wasn't aware... |
(to be more precise: I wasn't aware that "semantic" and "identifier" completion are different requests). |
Seems like we could just fall back to identifier completion when semantic completion is not available... |
I should have been more specific. It's a bit complex... it's technically the same request from a client perspective. When a completion request comes in, the server decides whether to query the semantic engine or not based on several factors. The request is then routed to the correct engine based on the decision. |
@r4nt I think we could easily change company-ycmd to take the completion request when parsing is ongoing. We could even make that a configurable behavior, which might make sense since everything else about company is pretty configurable. I'm not sure if that's the right approach, though, since they can get similar behavior (i.e. not defaulting to clang-complete) removing clang-complete from their |
@abingham - yea, I found people who have set up company-clang as fallback in their emacs configs. I think it would be best if @Valloric could change ycmd to do the following: |
|
@abingham Err, of course, certain users might prefer it to work differently, but I think this approach makes sense. Delegating to |
That makes sense, but will require a bit of work. It does come with a downside: currently, you are guaranteed to get a semantic completion after a semantic trigger or nothing at all. So if you get To be fair, semantic completion is displayed differently in the Vim pop-up menu (extra info on arguments etc) so the user will be able to tell that they're not getting semantic info. This is probably worth doing though. Open an issue on ycmd so I don't forget. Provide a link to this issue. |
I really prefer the way it is currently: to have the guarantee to get semantic completion after a semantic trigger. Even if it takes longer and I have to wait. @Valloric If you want to change this behavior please make an option to switch back to the current one if the user prefers it. |
Added: ycm-core/ycmd#67 |
@ptrv - yea, I think an option is the right way - it depends highly on the codebase (if you have to wait for 30 seconds, the trade-off might come out differently from when you have to wait 0.5 seconds :) |
It seems that this issue is resolving itself elsewhere, so I'm closing this until/unless anyone has any complaints. |
@abingham - btw, I think all the open issues I had are now resolved - thanks a lot for your work here, it's highly appreciated :) |
Great, thanks! Honestly when left to my own devices I tend towards "works well enough for me", and emacs-ycmd wouldn't have near the level of polish it has without the kind of input you and others have given. So keep the ideas coming. |
@Valloric - somehow vim-ycm doesn't completely disable completions during parsing, right?
@abingham - can we make emacs-ycmd somehow still take the completion request? Otherwise company seems to fall back to clang-complete, which seems strange as default behavior...
The text was updated successfully, but these errors were encountered: