-
Notifications
You must be signed in to change notification settings - Fork 19
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
Expand snippet placeholders #188
Comments
Does the information in |
I don't think it does, no. Or at least adding those two options mentioned there doesn't seem to change anything. |
What do I need on the server side to enable Go completion? |
You mean which server? If that's the case then: gopls which you can find here https://github.com/golang/tools/blob/master/gopls/doc/user.md Also, just realised that you will also need to create a
That's for LanguageClient-neovim to pass that initialization options to gopls so that it uses the placeholders that you saw on my gif. So the project structure to reproduce this would be something like this:
The go.mod and go.sum files are created by the go package manager, you can create those by running Sorry for the incomplete instructions in the original message. |
I need more details, because expanding snippets in general appears to work for me. Why do you need supertab? It has a mapping conflict with MUcomplete. Can you reproduce your issue without it? Why haven't you added the
What happens instead? I cannot find a snippet for Anyway, from your top animated GIF above it seems that it has expanded the snippet, so, what exactly is wrong there? I see that the placeholder has the form
Is that the issue? Also, in your top GIF, some error messages are shown as you are typing. I don't think that has anything to do with MUcomplete. |
Yeah sorry, supertab is not really needed here. I removed it and it's still reproducible. About the What I'm trying to achieve here is that pressing ctrl-k completes the completion item snippet and then jumps between the arguments of the function (in this case). Here's another gif that might make things clearer: Note that when I first press Ctrl-K the completion item snippet is expanded and the first argumet of the function is selected so that I can replace it by just typing. Pressing Ctrl-K a second time will jump to the second argument. As for the errors, that's fine, that's just LanguageClient-neovim showing me syntax errors because the file has invalid syntax while I'm completing the snippet. |
I guess what I'm looking to do with mucomplete is what ncm2-neosnippet provides https://github.com/ncm2/ncm2-neosnippet.
|
I managed to make this work by changing
I'm not sure of the correctness of this and if there are any other things that I should be taking into account, but that seems to work exactly the way I expected it to work for the few tests that I have ran so far. EDIT: Well, kinda 😁 . It freezes a little while getting the suggestions for Rust this way. And there are some completion items that don't expand as expected, not sure why yet. |
Sorry if this has been documented, I have tried a few different things but I can't seem to make it work as I expect it.
What I'm trying to do is expand the completion item snippets I get from LanguageClient-neovim via a keybinding but the results I've got so far are either have it expand on
CompleteDone
, which doesn't really work for me because I get expansion on situations were I don't really want to expand (for example when pressing while pum is visible to delete the word I just type and try something else), or it completes and expands but it inserts the placeholders, or it doesn't do any expanding.In order to reproduce what I'm getting you'd need this vimrc:
And here's a gif of what I'm getting:
Basically what's going on there is I type
log.Pri
, then move to thePrintln
entry with tab, and press<C-k>
. What I would expect there is that it expands the snippet, removes the gibberish from the placeholders and then lets me jump to the placeholders with another press of<C-k>
.Note that if I comment out the
LanguageClient_completionPreferTextEdit
setting then<C-k>
simply closes the pum, which I don't really understand why either, as I would expect it to expand the snippet anyways.For reference, here's how that looks (even with the setting above commented) with ncm2, which I would love to replace with mucomplete, as it seems a lot simpler and lighter.
On another note, I haven't been able to figure out how to configure mucomplete to get more results in the completion menu, as you can see I only get 3 or 4 results but I would like to get more (maybe even all?) completion items there.
The text was updated successfully, but these errors were encountered: