SirVer / ultisnips

UltiSnips - The ultimate snippet solution for Vim. Send pull requests to SirVer/ultisnips!
GNU General Public License v3.0
7.55k stars 691 forks source link

"Error detected while processing function UltiSnips#Edit[6]..provider#python3#Call:" #1553

Closed Wobblyyyy closed 6 months ago

Wobblyyyy commented 6 months ago

The assertion len(potentials >= 1 in the function _select_and_create_file_to_edit, invoked following the execution of :UltiSnipsEdit!, fails, causing an error. :checkhealth shows that python3 is properly configured, python3 and pynvim are up-to-date and working without issue. I am running nvim v0.6.1 on Ubuntu 22.04.01.

Expected behavior: Running UltiSnipsEdit! opens a window allowing snippets to be edited.

Actual behavior: Running UltiSnipsEdit! provides the following error:

Error detected while processing function UltiSnips#Edit[6]..provider#python3#Call:
line   18:
Error invoking 'python_execute' on channel 3 (python3-script-host):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/colin/.local/share/nvim/plugged/ultisnips/pythonx/UltiSnips/snippe
t_manager.py", line 940, in _file_to_edit
    return _select_and_create_file_to_edit(potentials)
  File "/home/colin/.local/share/nvim/plugged/ultisnips/pythonx/UltiSnips/snippe
t_manager.py", line 71, in _select_and_create_file_to_edit
    assert len(potentials) >= 1
AssertionError

Steps to reproduce Run UltiSnipsEdit!.

Minimal .nvimrc contents

set rtp+=~/.vim/bundle/Vundle.vim

let g:python3_host_prog = '/bin/python3.10'

call plug#begin()
Plug 'sirver/ultisnips'
call plug#end()
  1. Run nvim from the CLI, opening either an empty buffer or a file
  2. Run :UltiSnipsEdit!

SirVer commented 6 months ago

Cannot reproduce on Vanilla Vim. Can you?


This issue will be closed due to it only affecting Neovim and not core Vim.

Why is Neovim only best-effort?

UltiSnips maintenance is a lot of work. Reproducing bug reports is tedious, slow and error prone. The current maintainers have to limit their scope to provide a reasonable level of service to the community.

Neovim should work with any plugin that core vim works with. But in the past, Neovim support has been difficult for UltiSnips: It regularly had bugs that did not affect the core Vim distributions, i.e. Vim, gVim, MacVim, and Vim for Windows and its testing approach required a completely separate code path from core as well. Therefore, currently Neovim bugs are considered on a best effort basis.

UltiSnips is looking for an additional maintainer that is interested in bringing the Neovim level of service on par with core Vim. If you are interested in helping out, please reach out to SirVer.

Wobblyyyy commented 6 months ago

After following the steps in CONTRIBUTING.md and seeing no such error, I modified my .nvimrc to include Plug 'honza/vim-snippets', which I was missing, and everything worked. Turns out reading the documentation thoroughly is generally helpful... My apologies for not doing my homework.

SirVer commented 6 months ago

@Wobblyyyy Vim-snippets is optional, so this still sounds like a bug. Unfortunately, I lack time to even UltiSnips even on Vanilla Vim right now, debugging NeoVim issues - which have been gnarly and peculiar in the past - is above my possibilities. Thanks for reporting anyways!