-
-
Notifications
You must be signed in to change notification settings - Fork 958
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
"magic" completions not working #961
Comments
Please provide output so I could understand how it works. |
I've linked video and explanation in "Describe the bug". For example, |
Looks like that feature use custom command which requires extension support to work. |
OK. If you conclude that's the case you can close the issue as I don't have the inner knowledge whether it should be part of coc or not. |
Current behavior is bad though, since coc provides a behavior for these snippets, but it provides incorrect expansions. It would be ideal if they weren't at all provided, or provided but working. |
The language server should provide an option to disable feature, or check if it can be done with the client. |
OK. I'll report it back there. |
@chemzqm that’s not a custom command, that is snippet completion (see insertTextFormt in https://microsoft.github.io/language-server-protocol/specification#textDocument_completion). It’s true that the server should only send snippets if the client explicitly advertised support for them, but it should also be cool if coc.nvim supported snippets, they are a powerful feature! Though, IIRC, all vim plugins have trouble with non-trivial completions, so this might be a won’t fix due to some vim internal limitation. |
coc.nvim has full support for snippet of LSP, need verbose output from language server to understand why it's not work as expected. |
If this is helpful, here are the logs I get from VS Code: https://gist.github.com/matklad/d12ae81f18766c80f56727f2d848fc0a A specific
|
Should be bug of overlap range check for |
OK looks fixed on b24601e, thx :) |
Just noticed that some expansions are not putting the cursor in the right place, for example, |
Position need fix for plain text snippet https://github.com/neoclide/coc.nvim/blob/master/src/languages.ts#L609 |
Fixed |
I suspect repositioning is wrong when the snippet is single line, and text edits that remove text while expanding, happens on that line. Maybe that's why |
Reopening as it doesn't seem fixed. |
Please paste output from language server. |
@chemzqm my bad, it's expanding correctly in minimal |
The plugin conflicting with coc.nvim expansion is vim-matchup. For some reason having it cause bad expansion like in the gif above. |
Result from CocInfo
versions
vim version: NVIM v0.4.0-1198-g0dc73b87f
node version: v11.15.0
coc.nvim version: 0.0.72
term: tmux-256color
platform: linux
Messages
Output channel: watchman
[Info - 5:50:17 AM] watchman watching project: /home/francisco/Projects/samples/rust
[Info - 5:50:17 AM] subscribing "/.eslintr{c.js,c.yaml,c.yml,c,c.json}" in /home/francisco/Projects/samples/rust
[Info - 5:50:17 AM] subscribing "/.eslintignore" in /home/francisco/Projects/samples/rust
[Info - 5:50:17 AM] subscribing "/package.json" in /home/francisco/Projects/samples/rust
[Info - 5:50:17 AM] subscribing "/{.prettierrc,.prettierrc.json,.prettierrc.yaml,.prettierrc.yml,.prettierrc.js,package.json,prettier.config.js}" in /home/francisco/Projects/samples/rust
Output channel: snippets
[Info - 5:50:17 AM] watchman watching project: /home/francisco/.config/coc/ultisnips
[Info - 5:50:17 AM] subscribing "**/*.snippets" in /home/francisco/.config/coc/ultisnips
Output channel: prettier
Describe the bug
I just came to learn of "magic" completions supported by rust-analyzer that don't work with coc.nvim, but works on VSCode. What they are is explained here and how they should behave can be viewed in this video.
Reproduce the bug
Follow the wiki to install rust-analyzer
Create file
mini.vim
with:cargo init foo && cd foo
Start (neo)vim with command:
nvim -u mini.vim src/main.rs
in
main
typex.if
and expand the suggestionThe text was updated successfully, but these errors were encountered: