-
Notifications
You must be signed in to change notification settings - Fork 199
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
:label being used for completion insert instead of :newText #245
Comments
The first log shows items with |
Thanks very much @nemethf for handling all these issues minimally and providing sensible answers. I am so busy I just read them diagonally. |
No problem. I wonder, though, if we (you) could make the events buffer more useful, i.e., I'd like to replay the events, so that I could debug issues without bothering to install an exotic server. Regarding this issue, I followed the instructions to install gopls, but I probably ran into the "no file information for" bug, similar to this one. But I did not use windows. So I stopped investigating further and recommend trying out the PR cited above. |
This is actually a very good idea: an Emacs lisp program (but could also be some other language) that takes a file of events in eglot format and mimics a server. The server will kill itself if it receives input not in the form it expects. Some details would have to be ironed out regarding path names for example (they would have to be made relative to the events file, I think). Unfortunately, I don't have time to make this right now. You are right that installing exotic servers isn't a scalable solution. |
golang/go#31178 can be related |
Those instructions will pull the latest tagged release they have, which is not in a good working state. I installed it by cloning the repo and building
Then I set up |
Isn't that just for filtering though? That parameter should not effect the insertion of the selected match right? The second example using The first only has |
The I decided I won't install any lsp servers unless it can be run in a docker container. So it's kind of a stalemate :), as you won't try #235 out, and I can't replicate your issue without a server. Unfortunately, @joaotavora's suggestion might work only if the event log is specially crafted since user events (cursor movements, etc.) are not stored there. However, I put together a very simple replay server. It can replay an event file if you follow these instructions when creating the event logs. Open the go file with eglot disabled. Go to the end of "fmt.Pr". Enable eglot with |
@nemethf It looks like #235 does fix the issue I am having with my LSP server One other issue with that is that in the completion options listed it only shows the remaining text instead of the |
For a CompletionItem, the server may send label, detail, documentation, filterText, textEdit. It's not clear to me what's the best approach to mapping these fields to the M-C-i interface. Company-completion has richer interface, so there's a higher chance of creating a more intuitive interface, but it's more complicated, so I understand it even less. Hopefully, when the PR is accepted, this will be ironed out. |
So #235 wasn't merged into the master branch, but João rewrote this part of Eglot. @paulbdavis, do you still see the original problem? |
I assume this is fixed and close the issue. If it's not, comment here and I'll reopen. |
Thanks for this housekeeping @nemethf . It is very useful. |
Testing this go file using
gopls
as the lsp server (the official server from the go project)The data coming back for the matches in the events buffer have the correct data in the
:newText
field but instead the:label
is appliedThis is tested on the MELPA stable version of eglot without using the built in completion (no company)
This is the data coming back from the completion on the
fmt.Pr
in the example aboveWhen instead using
bingo
for the golang LSP, the data it returns for that same completion is a bit different (note the full text replacement in:newText
)Is this an issue in eglot or an issue of gopls not following some spec correctly?
The text was updated successfully, but these errors were encountered: