Closed ErrEoE closed 4 years ago
I still can't repro, so all I can do is show a cleaned up error.
Error detected while processing
BufEnter Autocommands for "*"..
function <SNR>29_OnBufferEnter[12]..
<SNR>29_OnFileReadyToParse[11]..
<SNR>29_ClearSignatureHelp[7]..
BufEnter Autocommands for "*"..
function <SNR>29_OnBufferEnter[12]..
<SNR>29_OnFileReadyToParse[11]..
<SNR>29_ClearSignatureHelp:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\mss\.vim\bundle\repos\github.com\ycm-core\YouCompleteMe\python\ycm\youcompleteme.py", line 360, in ClearSignatureHelp
self.UpdateSignatureHelp( {} )
File "C:\Users\mss\.vim\bundle\repos\github.com\ycm-core\YouCompleteMe\python\ycm\youcompleteme.py", line 366, in UpdateSignatureHelp
self._signature_help_state = signature_help.UpdateSignatureHelp(
File "C:\Users\mss\.vim\bundle\repos\github.com\ycm-core\YouCompleteMe\python\ycm\signature_help.py", line 82, in UpdateSignatureHelp
vim.eval( f"popup_close( { state.popup_win_id } )" )
vim.error: Vim:E994: Not allowed in a popup window
E858: Eval did not return a valid python object
E171: Missing :endif
E382: Cannot write, 'buftype' option is set
I can repro in gvim in windows.
in fact, it's worse because vim gets stuck in a mode where you can't do anything, it just keeps saying "Not allowed in a popup window"
minimal vimrc:
" windows default encoding is not supported
set encoding=utf-8
set guifont=Lucida_Console:h9:cDEFAULT
" If you using neovim and python isn't loading, copy your python setup from your
" vimrc here:
"
" let g:python3_host_prog = '/path/to/python3/with/neovim/module'
"
" But remember that neovim is not officially supported, so please reproduce in
" Vim.
" Enable debugging
let g:ycm_keep_logfiles = 1
let g:ycm_log_level = 'debug'
" If the base settings don't repro, paste your existing config for YCM only,
" here:
" let g:ycm_....
" Load YCM (only)
let &rtp .= ',' . expand( '<sfile>:p:h' )
syntax on
filetype plugin indent on
let g:ycm_autoclose_preview_window_after_completion=0
let g:ycm_autoclose_preview_window_after_insertion=0
let g:ycm_add_preview_to_completeopt = 'popup'
let g:ycm_confirm_extra_conf = 0
let g:ycm_complete_in_comments=0
let g:ycm_log_level = 'error'
let g:ycm_collect_identifiers_from_comments_and_strings = 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_auto_hover = ''
let g:ycm_use_clangd = 1
let g:ycm_clangd_args = ['--header-insertion=never', '--include-ineligible-results']
let g:ycm_clangd_uses_ycmd_caching = 0
I can repro in macOS on latest vim too.
I think this was broken when we added completion in empty buffers.
We need to blacklist some more buftypes:
try this patch:
diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim
index 4cfb08dc..a5fa4a18 100644
--- a/autoload/youcompleteme.vim
+++ b/autoload/youcompleteme.vim
@@ -63,7 +63,9 @@ let s:pollers = {
let s:buftype_blacklist = {
\ 'help': 1,
\ 'terminal': 1,
- \ 'quickfix': 1
+ \ 'quickfix': 1,
+ \ 'popup': 1,
+ \ 'nofile': 1,
\ }
let s:last_char_inserted_by_user = v:true
let s:enable_hover = 0
Use this patch, I have not yet repro it.
I think this is a workaround while we try and understand this.
let g:ycm_filetype_blacklist = {
\ 'ycm_nofiletype': 1
\ }
@habamax FYI. It looks like the patch to add empty-filetype support caused this really weird regression. I don't think that's strictly the issue, but it's highlighted a problem where the &filetype
of popup windows shimmers:
Parsing file FileType cpp
Clear signature help File Ready to parse
Parsing file Resend
Clear signature help File Ready to parse
Enter buffer 2 , , popup
Reparse required for 2 , , popup : 0
Enter buffer 2 , ,
Reparse required for 2 , , : 1
Reqruies reparse 2 , ,
Parsing file OnBufferEnter
Clear signature help File Ready to parse
Enter buffer 1 , cpp ,
See there that buffer 2
goes from popup
to ` buftype (
Enter buffer 2 , &filetype , &buftype `). Ultimately this makes us try and parse the signature help popup and any preview popup that goes with it. I think it might be a vim bug, but we may have to revert the YCM change in the interim, or try and turn it off by default.
I have tried to get this error with python, golang and godot and couldn't repro anything similar there.
About reverting the patch -- yeah, would be unfortunate for me, but I always can use forked unreverted repo.
I'm thinking that we could blacklist ycm_nofiletype for now (and you can "undo" that in your vimrc)
I'm thinking that we could blacklist ycm_nofiletype for now (and you can "undo" that in your vimrc)
yeah, sure!
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
inside the brackets) before filing your issue:vim --version
.:YcmDebugInfo
.:YcmToggleLogs
command.vim -Nu /path/to/YCM/vimrc_ycm_minimal
, including what I expected to happen and what actually happened.install.py
(orcmake
/make
/ninja
) including its invocationThank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.
Issue Details
gvim -Nu d:\mini_vimrc.txt
:edit test.cpp
input printf("", and use <tab> select size_t
The ":messages" output.
Diagnostic data
Output of
vim --version
Output of
YcmDebugInfo
Output of
YcmDiags
Output of
git rev-parse HEAD
in YouCompleteMe installation directoryContents of YCM, ycmd and completion engine logfiles
OS version, distribution, etc.
Output of build/install commands