ncm2 / ncm2-ultisnips

44 stars 3 forks source link

Deletion of lspitem field prevents autoimport from working #21

Open j-hui opened 3 years ago

j-hui commented 3 years ago

I find that when using:

The ncm2 popup menu tells me that I can autoimport with some entry, but the autoimport action is never completed. After doing some digging, I found that the problem comes from here:

https://github.com/ncm2/ncm2-ultisnips/blob/a7462f3b7036dce045a472d8ec9d8fb9fb090212/pythonx/ncm2_lsp_snippet/utils.py#L143

Since the lspitem field is removed from user_data, LangaugeClient-neovim does not know to perform the text edit corresponding to the autoimport.

I find that removing ncm2-ultisnips, or commenting out this line, fixes the problem.

I understand that this is probably here to prevent some kind of interference between LanguageClient-neovim and ultisnips, but is there another workaround that doesn't involve disabling autoimport?