-
Notifications
You must be signed in to change notification settings - Fork 184
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
Inconsistent autocomplete behavior #745
Comments
Hi, thanks for the detailed report. I feel a bit unclear from the extra steps before/after step 3. Could it be that triggering the completion shortcut before typing Could you try two things:
|
Here's another capture with lsp only set to true: and this is the log: |
That's much clearer, thanks. In your screenshot you can also see an empty response in the console when you are pressing ctrlspace after deleting the first "Req":
Once intelephense sends an empty response at a given location, we will cache it until you edit the document. If you can get some logging from the server then we could know for sure, but I suspect intelephense thinks the document is in a different state than your editor shows. |
I noticed that too, it seems invoking the autocomplete with no input does not trigger the LSP hints. After that, even if you type something in, it seems think nothing has changed, unless you remove the brackets or shift the line to another line and then type in something. So, you think the problem is with lsp-intelephense? It also seems this is only a problem when you have the sublime's auto_complete set to off. Look at it with the But it still goes back to the buggy behavior as soon as yo hit ctrl+space and invoke the autocomplete manually. |
Yes, most servers return completion items if the completion request has no characters preceding the cursor. Intelephense's choice not to is the cause for what you're seeing with LSP. Have you tried VS Code with intelephense? If the behaviour there is better then we can have a closer look at their handling of empty responses. |
Tested with VS Code + Intelephense. It has the same behavior, if you invoke the code complete with nothing typed in, it only gives you local suggestions. However, it's able to recover without moving things around. I did it twice so it can be seen easier. Capture: Note: There is a whole bunch of code at the bottom outside the scope of the recorder with the Request keyword already in. That's where the local "Request" is coming from. |
If there are no completion results, typing view.s would trigger requests at both '.' and 's'.
* Don't run on_completion_inserted on insert_best_completion Pressing <tab> in documents results in huge "LSP: No match for inserted "<entire document>.." entries in the console. * Don't cancel requested completions for the exact same word while typing ahead. If typing view.settings, completion at dot is cancelled by "s", "e" etc. even though original request is still relevant * Don't present completion results from previous word If typing view.settings() quickly, a popup would show at the cursor offering "settings()". In the response handler, we detect if cursor has passed a word boundary and ignore the result if so. * Revert fix for #745, causing extra requests after trigger character If there are no completion results, typing view.s would trigger requests at both '.' and 's'.
Re-opening because I reverted the fix for causing extra completion requests on all servers. I think it can be fixed by differentiating between |
I propose to wontfix for ST build 3211. For later builds of ST, we'll have the completion logic almost entirely rewritten. Including having way less state, so what you're asking for is probably fixed alongside the changes. |
Description
When you invoke sublime's autocomplete without any string, a consequent invocation will not show any LSP information. Please see the gif.
Steps to reproduce
Unless the line is moved, or the parenthesizes removed, LSP will not work again, defaulting to sublime autocomplete only.
Expected behavior
LSP should always show the hints when the autocomplete is invoked.
Environment
Also submitted to:
sublimehq/sublime_text#3005
The text was updated successfully, but these errors were encountered: