-
Notifications
You must be signed in to change notification settings - Fork 401
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
Selection cursor doesn't appear at the top of the autocompletion list for gopls #1809
Comments
It turns out that local cmp = require("cmp")
cmp.setup({
preselect = cmp.PreselectMode.None
}) |
With this setting there is no preselect at all. What if I want the first one to be selected always? |
The problem is that Unfortunatly, I can reopen this issue if you want. But at the moment, I'm not interested in any further investigation into this issue. |
Another one issue with this: I'd love to see this fixed this way: "preselected" item is always first in a list, but not selected on menu open (because of |
FAQ
Announcement
Minimal reproducible full config
Description
With
gopls
, the selection cursor will not appear at the top of the autocompletion list as it does with other language servers such aspyright
,jdtls
,tsserver
, etc. This inconsistency bothers me because it often led to typing mistakes (since all other language servers ensure that the cursor always appears at the beginning of the list, withgopls
, I have the tendency to press enter thinking that the top item is selected when in reality, the cursor is located at an item somewhere below the list).I will use two examples to illustrate this issue.
Example 1: snippets
problematic_gopls_completion.snippets.mp4
As you can see, when the completion list pops up, the second item is selected instead of the top item. Here is the lsp log file for this example: snippets-completion-issue.log
Example 2: normal autocompletion
problematic_gopls_completion.normal.completion.mp4
In this example, it seems to me like the cursor pre-selects the item based on alphabetical order despite the fact that the autocompletion list isn't ordered alphabetically. Here is the lsp log file: normal-autocompletion-issue.log
Steps to reproduce
The environment used to demonstrate the issue can be set up via the following steps:
go
andgopls
$ mkdir testing
cd testing
$ go mod init example/testing
$touch test.go
nvim -u /path/to/minimal_init.lua test.go
package
on the first line of the file.At this point, the behavior on your screen should mirror the behavior in the video I posted above.
Expected behavior
The cursor should select the top item in the autocompletion list.
Actual behavior
The cursor does not select the top item in the autocompletion list.
Additional context
Please note that this behavior occurs with
gopls
only and no other language server. I'm aware that this likely indicates that the issue is withgopls
. But I have already opened an issue withgopls
golang/go#61533. The developer's response is that the issue isn't with them.The text was updated successfully, but these errors were encountered: