-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not depend on UltiSnips internals
Use UltiSnips#SnippetsInCurrentScope to fetch snippets. Add an entry in the FAQ about the :UltiSnipsAddFiletypes command.
- Loading branch information
Showing
3 changed files
with
48 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have UltiSnips installed, after update the code, i got error "E117: Unknown function: UltiSnips#SnippetsInCurrentScope"
5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you paste the full error message?
5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error detected while processing function 21_OnBufferRead:
line 17:
E117: Unknown function: UltiSnips#SnippetsInCurrentScope
E15: Invalid expression: UltiSnips#SnippetsInCurrentScope( 1 )
Error detected while processing function 85_AcceptSelection..webdevicons#ctrlPOpenFunc..ctrlp#acceptfile:
line 49:
E171: Missing :endif
after I install UltiSnips, this issue no longer exists
5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you still get the error when replacing
except vim.error:
byexcept Exception:
? I can't reproduce without UltiSnips installed.5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange backtrace:
85_AcceptSelection..webdevicons#ctrlPOpenFunc..ctrlp#acceptfile
What plugin is that? Could it be an incompatibility with yCM?
5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to reproduce with this Vim but it is not specific to YouCompleteMe. This version of Vim does not throw a Python exception when an error occurs while evaluating a Vim expression. The following code in Vimscript:
will raise these errors:
E121: Undefined variable: invalid_eval E15: Invalid expression: invalid_eval
while the documentation (
:h python-error
) says:I don't think there is anything we can do to work around this bug. I recommend to use a newer version of Vim on Windows.
5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks micbou, i update my vim to 8.0, it works
5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the same error on vim 7.4 and Ubuntu 14.04
[Output of messages]
Messages maintainer: Bram Moolenaar [email protected]
"youcompleteme.py" 699L, 25188C
Error detected while processing function youcompleteme#Enable..14_OnBufferRead:
line 17:
E117: Unknown function: UltiSnips#SnippetsInCurrentScope
Error detected while processing function youcompleteme#Enable..14_OnBufferRead:
line 17:
E15: Invalid expression: UltiSnips#SnippetsInCurrentScope( 1 )
I tried using Exception instead of vim.error and still see the same error.
[Vim version]
sumeetb@u847beb1328d857c085be:~/.vim/bundle/YouCompleteMe$ vim --version | grep python
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
This errors disappear once I have UltiSnips installed.
5dca552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sumeetb25 if you're using the vim that ships with Ubuntu 14.04 than there is a bug in that version of vim which prevents this for working. There is #2337 with a fix for that version of vim but we're actually thinking of bumping the minimum vim version to 7.4.143.