pearofducks / ansible-vim

A vim plugin for syntax highlighting Ansible's common filetypes
MIT License
796 stars 98 forks source link

SnippetSyntaxError: Invalid line 'priority -50' #96

Closed dvzrv closed 4 years ago

dvzrv commented 4 years ago

When building 2.1 and generating the ultisnips snippet I get the following in vim:

An error occured. This is either a bug in UltiSnips or a bug in a
snippet definition. If you think this is a bug, please report it to
https://github.com/SirVer/ultisnips/issues/new
Please read and follow:
https://github.com/SirVer/ultisnips/blob/master/CONTRIBUTING.md#reproducing-bugs

Following is the full stack trace:
Traceback (most recent call last):
  File "/usr/share/vim/vimfiles/pythonx/UltiSnips/err_to_scratch_buffer.py", line 18, in wrapper
    return func(self, *args, **kwds)
  File "/usr/share/vim/vimfiles/pythonx/UltiSnips/snippet_manager.py", line 905, in _track_change
    self._try_expand(autotrigger_only=True)
  File "/usr/share/vim/vimfiles/pythonx/UltiSnips/snippet_manager.py", line 749, in _try_expand
    snippets = self._snips(before, False, autotrigger_only)
  File "/usr/share/vim/vimfiles/pythonx/UltiSnips/snippet_manager.py", line 629, in _snips
    source.ensure(filetypes)
  File "/usr/share/vim/vimfiles/pythonx/UltiSnips/snippet/source/file/base.py", line 31, in ensure
    self._load_snippets_for(ft)
  File "/usr/share/vim/vimfiles/pythonx/UltiSnips/snippet/source/file/base.py", line 53, in _load_snippets_for
    self._parse_snippets(ft, fn)
  File "/usr/share/vim/vimfiles/pythonx/UltiSnips/snippet/source/file/base.py", line 69, in _parse_snippets
     raise SnippetSyntaxError(filename, line_index, msg)
 UltiSnips.snippet.source.file.base.SnippetSyntaxError: Invalid line 'priority -50' in /usr/share/vim/vimfiles/snippets/ansible.snippets:1

Dependencies

pearofducks commented 4 years ago

This happens upon generation of snippets? Or attempting to use the snippets after generation?

Either way, I can't reproduce this.

dvzrv commented 4 years ago

This happens after installation, as soon as I open an ansible yaml file, go to insert mode and press enter.

pearofducks commented 4 years ago

Yeah I can't reproduce this from HEAD using vim-plug on Mac or Debian.

dvzrv commented 4 years ago

Is vim-ultisnips running with python3 or python2 and which version of ultisnips is it?

pearofducks commented 4 years ago

I don't know what ultisnips uses as a default, but I'd guess python2.

I'm using vim-plug, which will just grab HEAD from the GitHub repo

dvzrv commented 4 years ago

Closing because void: https://github.com/pearofducks/ansible-vim/pull/98#issuecomment-657584687