thomasfaingnaert / vim-lsp-ultisnips

Language Server Protocol snippets in vim using vim-lsp and UltiSnips
BSD 3-Clause "New" or "Revised" License
37 stars 2 forks source link

handle_snippet is called when using default Vim auto completion. #2

Closed d-karl closed 5 years ago

d-karl commented 5 years ago

Hey, I have a minor problem with this plugin, which I generally love. It works great when I use ncm2 for auto completion, but I get the following error message whenever using default vim autocomplete:

E474: Attempt to decode a blank string
Error detected while processing function <SNR>182_handle_snippet:
line    5:
E474: Failed to parse 

I get this anytime I use normal vim autocomplete, for instance for files <C-x><C-f> upon accepting an autocomplete entry. Is this a configuration error on my part, or is this a bug?

thomasfaingnaert commented 5 years ago

This is indeed a bug, though only reproducible in Neovim. In Vim :echo json_decode('') displays v:none, but apparently Neovim throws when the input to json_decode is empty. Can you check if fix-json-e474 solves the issue?

d-karl commented 5 years ago

Hey, apologies for the poor bug report, it has occured to me that I could have at least mentioned that I am using Neovim :face_with_head_bandage:. I have been testing the indicated fix branch all day, it has fixed the bug and has had no unintended side effects as far as I can tell. Many thanks!

thomasfaingnaert commented 5 years ago

No need to apologise :) Thanks a lot for your bug report and for trying out my plugin!