Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:
vim --version.:YcmDebugInfo.:YcmToggleLogs command.install.py (or cmake/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.
Provide a clear description of the problem, including the following key
questions:
Writing a tool base on clang, just typing normally
Include steps to reproduce here.
Include description of a minimal test case, including any actual code required
to reproduce the issue.
YCM works fine, showing completion list very fast.
Include description of the expected behaviour.
Strange behavior. YCM is slow, but I didn't know why.
Include description of the observed behaviour, including actual output,
screenshots, etc.
vim --versionVIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 14 2017 11:19:21)
MacOS X (unix) version
Included patches: 1-1098
Compiled by Homebrew
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +find_in_path -mouse_sysmouse -tag_any_white
+arabic +float +mouse_urxvt +tcl
+autocmd +folding +mouse_xterm +termguicolors
+balloon_eval -footer +multi_byte +terminal
+browse +fork() +multi_lang +terminfo
++builtin_terms +fullscreen -mzscheme +termresponse
+byte_offset -gettext +netbeans_intg +textobjects
+channel -hangul_input +num64 +timers
+cindent +iconv +odbeditor +title
+clientserver +insert_expand +packages +toolbar
+clipboard +job +path_extra +transparency
+cmdline_compl +jumplist +perl +user_commands
+cmdline_hist +keymap +persistent_undo +vertsplit
+cmdline_info +lambda +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con_gui +lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind -X11
+dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent +xim
+emacs_tags +mouseshape +startuptime -xpm
+eval +mouse_dec +statusline -xsmp
+ex_extra -mouse_gpm -sun_workshop -xterm_clipboard
+extra_search -mouse_jsbterm +syntax -xterm_save
+farsi +mouse_netterm +tag_binary
+file_in_path +mouse_sgr +tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -F/usr/local/opt/python/Frameworks -I/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -L/usr/local/lib -L. -L/usr/local/lib -F/usr/local/opt/python/Frameworks -L/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -framework CoreFoundation -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework Cocoa -L/usr/local/opt/lua/lib -llua -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -F/usr/local/opt/python/Frameworks -framework Python -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby
Place the output here, or a link to a gist.
YcmDebugInfoPlace the output here, or a link to a gist.
Printing YouCompleteMe debug information...
-- Client logfile: /var/folders/60/d7dj9d5x5jvfc41f32wcfq900000gn/T/ycm_o9JR9e.log
-- Server Python interpreter: /usr/local/opt/python/bin/python2.7
-- Server Python version: 2.7.13
-- Server has Clang support compiled in: True
-- Clang version: Apple LLVM version 9.0.0 (clang-900.0.37)
-- Extra configuration file found and loaded
-- Extra configuration path: /Users/gaoge/Development/clang-tools/.ycm_extra_conf.py
-- C-family completer debug information:
-- Compilation database path: None
-- Flags: ['-x', 'c++', '-DNDEBUG', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS', '-D__
STDC_LIMIT_MACROS', '-I/Users/gaoge/Development/clang-tools/src', '-I/usr/local/Cellar/llvm/4.0.1
/include', '-W', '-Wall', '-Wcast-qual', '-Wcovered-switch-default', '-Wdelete-non-virtual-dtor',
'-Werror=date-time', '-Wmissing-field-initializers', '-Wno-long-long', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-Wstring-conversion', '-Wwrite-strings', '-std=c++11', '-isystem', '/usr/l
ocal/Cellar/llvm/5.0.0/include/c++/v1', '-isystem', '/usr/local/include', '-isystem', '/usr/local
/Cellar/llvm/5.0.0/lib/clang/5.0.0/include', '-isystem', '/usr/include', '-resource-dir=/Users/ga
oge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../clang_includes', '-isystem', '/Applicatio
ns/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1', '-isyste
m', '/Library/Developer/CommandLineTools/usr/include/c++/v1', '-isystem', '/usr/local/include', '
-isystem', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/in
clude', '-isystem', '/Library/Developer/CommandLineTools/usr/include', '-isystem', '/usr/include'
, '-isystem', '/System/Library/Frameworks', '-isystem', '/Library/Frameworks', '-isystem', '/Appl
ications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/inc
lude', '-isystem', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Develope
r/SDKs/MacOSX.sdk/usr/include', '-fspell-checking']
-- Server running at: http://127.0.0.1:54392
-- Server process ID: 5384
-- Server logfiles:
-- /var/folders/60/d7dj9d5x5jvfc41f32wcfq900000gn/T/ycmd_54392_stdout__tLYS0.log
-- /var/folders/60/d7dj9d5x5jvfc41f32wcfq900000gn/T/ycmd_54392_stderr_iH0P8h.log
Include link here to a gist containing the entire logfiles for ycm, ycmd
and any completer logfiles listed by:YcmToggleLogs.
Available logfiles are:
ycm_o9JR9e.log
ycmd_54392_stderr_iH0P8h.log
ycmd_54392_stdout__tLYS0.log
ycm_log
2017-09-16 23:59:47,401 - ERROR - Unable to connect to server
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 227, in CheckIfServerIsReady
'ready' )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 68, in GetDataFromHandler
timeout ) )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 180, in JsonFromFuture
response = future.result()
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 404, in result
return self.__get_result()
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
raise self._exception
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=54392): Max retries exceeded with url: /ready (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x118651e90>: Failed to establish a new connection: [Errno 61] Connection refused',))
2017-09-16 23:59:47,505 - ERROR - Unable to connect to server
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 227, in CheckIfServerIsReady
'ready' )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 68, in GetDataFromHandler
timeout ) )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 180, in JsonFromFuture
response = future.result()
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 397, in result
return self.__get_result()
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py", line 356, in __get_result
raise self._exception
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=54392): Max retries exceeded with url: /ready (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x1186518d0>: Failed to establish a new connection: [Errno 61] Connection refused',))
2017-09-17 00:01:00,345 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 60, in RawResponse
raise MakeServerException( e )
ServerError: RuntimeError: No completions found; errors in the file?
2017-09-17 00:02:01,253 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 60, in RawResponse
raise MakeServerException( e )
ServerError: RuntimeError: No completions found; errors in the file?
2017-09-17 00:04:22,633 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 60, in RawResponse
raise MakeServerException( e )
ServerError: RuntimeError: No completions found; errors in the file?
2017-09-17 00:04:22,726 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 60, in RawResponse
raise MakeServerException( e )
ServerError: RuntimeError: Still parsing file, no completions yet.
2017-09-17 00:04:22,918 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 60, in RawResponse
raise MakeServerException( e )
ServerError: RuntimeError: Still parsing file, no completions yet.
2017-09-17 00:05:28,555 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 53, in RawResponse
self._response = JsonFromFuture( self._response_future )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
raise MakeServerException( response.json() )
ServerError: RuntimeError: Still parsing file, no completions yet.
2017-09-17 00:05:28,582 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 53, in RawResponse
self._response = JsonFromFuture( self._response_future )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
raise MakeServerException( response.json() )
ServerError: RuntimeError: Still parsing file, no completions yet.
2017-09-17 00:05:29,036 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 53, in RawResponse
self._response = JsonFromFuture( self._response_future )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
raise MakeServerException( response.json() )
ServerError: RuntimeError: Still parsing file, no completions yet.
2017-09-17 00:10:22,962 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/command_request.py", line 57, in Start
'run_completer_command' )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 78, in PostDataToHandler
timeout ) )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
raise MakeServerException( response.json() )
ServerError: ValueError: No documentation available for current context
2017-09-17 00:10:39,270 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/command_request.py", line 57, in Start
'run_completer_command' )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 78, in PostDataToHandler
timeout ) )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 183, in JsonFromFuture
raise MakeServerException( response.json() )
ServerError: ValueError: No documentation available for current context
2017-09-17 00:20:55,598 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 60, in RawResponse
raise MakeServerException( e )
ServerError: RuntimeError: No completions found; errors in the file?
2017-09-17 00:20:56,819 - ERROR - Error while handling server response
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/base_request.py", line 214, in HandleServerException
yield
File "/Users/gaoge/.vim/plugged/YouCompleteMe/autoload/../python/ycm/client/completion_request.py", line 60, in RawResponse
raise MakeServerException( e )
ServerError: RuntimeError: No completions found; errors in the file?
ycmd_stderr
...
2017-09-17 00:13:37,444 - INFO - Received event notification
2017-09-17 00:13:37,444 - INFO - Adding buffer identifiers for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
2017-09-17 00:13:37,682 - INFO - Received event notification
2017-09-17 00:13:37,682 - INFO - Adding buffer identifiers for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
2017-09-17 00:14:42,351 - INFO - Received event notification
2017-09-17 00:14:42,351 - INFO - Adding buffer identifiers for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
2017-09-17 00:14:52,741 - INFO - Received debug info request
2017-09-17 00:14:52,742 - ERROR - No semantic completer exists for filetypes: [u'qf']
Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/handlers.py", line 237, in DebugInfo
request_data ).DebugInfo( request_data )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/handlers.py", line 284, in _GetCompleterForRequestData
return _server_state.GetFiletypeCompleter( request_data[ 'filetypes' ] )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'qf']
2017-09-17 00:19:47,254 - INFO - Received health request
2017-09-17 00:20:51,568 - INFO - Received event notification
2017-09-17 00:20:51,568 - INFO - Adding buffer identifiers for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
2017-09-17 00:20:54,296 - INFO - Received event notification
2017-09-17 00:20:54,297 - INFO - Adding ONE buffer identifier for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
2017-09-17 00:20:54,887 - INFO - Received completion request
2017-09-17 00:20:55,105 - INFO - Received completion request
2017-09-17 00:20:55,551 - INFO - Received event notification
2017-09-17 00:20:55,552 - INFO - Adding ONE buffer identifier for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
2017-09-17 00:20:55,554 - INFO - Received completion request
2017-09-17 00:20:55,586 - ERROR - Exception from semantic completer (using general): Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/handlers.py", line 103, in GetCompletions
.ComputeCandidates( request_data ) )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 217, in ComputeCandidates
candidates = self._GetCandidatesFromSubclass( request_data )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 233, in _GetCandidatesFromSubclass
raw_completions = self.ComputeCandidatesInner( request_data )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/cpp/clang_completer.py", line 113, in ComputeCandidatesInner
raise RuntimeError( NO_COMPLETIONS_MESSAGE )
RuntimeError: No completions found; errors in the file?
2017-09-17 00:20:56,182 - INFO - Received completion request
2017-09-17 00:20:56,781 - INFO - Received event notification
2017-09-17 00:20:56,782 - INFO - Adding ONE buffer identifier for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
2017-09-17 00:20:56,786 - INFO - Received completion request
2017-09-17 00:20:56,812 - ERROR - Exception from semantic completer (using general): Traceback (most recent call last):
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/handlers.py", line 103, in GetCompletions
.ComputeCandidates( request_data ) )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 217, in ComputeCandidates
candidates = self._GetCandidatesFromSubclass( request_data )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 233, in _GetCandidatesFromSubclass
raw_completions = self.ComputeCandidatesInner( request_data )
File "/Users/gaoge/.vim/plugged/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/cpp/clang_completer.py", line 113, in ComputeCandidatesInner
raise RuntimeError( NO_COMPLETIONS_MESSAGE )
RuntimeError: No completions found; errors in the file?
2017-09-17 00:20:57,603 - INFO - Received completion request
2017-09-17 00:20:57,776 - INFO - Received completion request
2017-09-17 00:20:57,942 - INFO - Received event notification
2017-09-17 00:20:57,942 - INFO - Adding ONE buffer identifier for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
2017-09-17 00:20:58,444 - INFO - Received completion request
2017-09-17 00:20:58,750 - INFO - Received completion request
2017-09-17 00:21:00,212 - INFO - Received event notification
2017-09-17 00:21:00,212 - INFO - Adding ONE buffer identifier for file: /Users/gaoge/Development/clang-tools/src/combine.cpp
...
ycmd_stdout
serving on http://127.0.0.1:54392
Include system information here.
macOS 10.12.6
Include link to a gist containing the invocation and entire output of
install.pyif reporting an installation issue.
Can you define "slow" ? Is it OK for a trivial project?
Please post relevant benchmarks, demo screencast or something.
Also, what's in :YcmDiags ? Are there problems parsing the file? As you will have seen when you read the README, completions can be slow if libclang is not able to create a preamble. I can see that ycmd is frequently reporting"
RuntimeError: No completions found; errors in the file?
Which indicates that libclang is failing to parse your file successfully.
FWIW I regularly use YCM with clang's codebase and performance is fine.
Very Strange. When I typing:
CompilerInstance CI;
C[cursor]
It should only trigger tags completer which should be very fast, no semantic completer which may be slow.

You can see I just hit keyboard regularly, but characters didn't show in screen expected. It appear or disapear discontinuously.
What is the value of ycm_min_num_of_chars_for_completion ? The default is 2, so after C I wouldn't expect _any_ suggestion.
" ===== YouCompleteMe =====
" highlight ERROR line
highlight YcmErrorLine guibg=#433D3D
" global YouCompleteMe setting file location
let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py'
" auto-close preview window
let g:ycm_autoclose_preview_window_after_completion = 0
let g:ycm_min_num_of_chars_for_completion = 1
" complete file path
let g:ycm_filepath_completion_use_working_dir = 1
let g:ycm_extra_conf_vim_data = ['&filetype']
let g:ycm_python_binay_path = "python3"
let g:ycm_error_symbol = 'x'
let g:ycm_warning_symbol = '!'
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_confirm_extra_conf = 0
" prevent python because i want use python-mode instead of YouCompleteMe
let g:ycm_filetype_blacklist = {
\ 'tagbar' : 1,
\ 'qf' : 1,
\ 'notes' : 1,
\ 'markdown' : 1,
\ 'unite' : 1,
\ 'text' : 1,
\ 'vimwiki' : 1,
\ 'pandoc' : 1,
\ 'infolog' : 1,
\ 'mail' : 1,
\ 'python' : 1,
\}
au FileType c,cpp,objc,objcpp,python nnoremap <leader>gd :YcmCompleter GoTo<CR>
au FileType c,cpp,objc,objcpp,python nnoremap <leader>gt :YcmCompleter GetType<CR>
au FileType c,cpp,objc,objcpp,python nnoremap <leader>gi :YcmCompleter GoToInclude<CR>
au FileType python nnoremap <leader>gc :YcmCompleter GetDoc<CR>
au FileType c,cpp,objc,objcpp nnoremap <leader>gf: YouCompleteMe FixIt<CR>
Use C[cursor] as example is not proper. You can see gif. When I type Dia[...] second time, it appear suddenly, not one by one.
Something else block UI?
Seems code_color block UI. Do YCM has any plan to support semantic highlight?
I can't see a problem in the inserted gif, but I think you're saying that the problem is with code_color which I assume is another plugin. YCM does not block the GUI for completions.
Do YCM has any plan to support semantic highlight?
Take a look at DyeVim by @davits. It uses ycmd to provide semantic highlighting.
If you disable code_color does the problem go away ?
In gif, whole Dia appears suddenly, not D i a, one by one. I know DyeVim, but it use a forked YCM.
After disable code_color, simply test, can not reproduce the problem.
OK, so the problem is with code_color then, so closing.
@puremourning sorry for comment again. Yes, color_coded will cause vim slow, because it parse source code with wrong include search path, then raise a lot errors. But after fix color_coded issue, I faced this problem again.
After analysis YCM working phases, this problem produced because of the preview window. Below is my settings:
let g:ycm_add_preview_to_completeopt = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_autoclose_preview_window_after_completion = 0
When I write code based on llvm which has great doxygen style comments, every up/down hittings cause corresponding doc show in preview, but it has a performance issue which cause vim slow.
When Vim opens the preview window, it triggers the BufEnter autocommand event on the preview window then on the current window. This may explain the slowness you are experiencing if one of your plugins does some costly computation on the BufEnter event. We had this issue with YCM but it was fixed in PR https://github.com/Valloric/YouCompleteMe/pull/2312. Type :verbose autocmd BufEnter to see which plugins are using the BufEnter event.
Below is my output of :verbose autocmd BufEnter:
--- Auto-Commands ---
filetypedetect BufEnter
*.xpm if getline(1) =~ "XPM2" | setf xpm2 | else | setf xpm | endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
*.xpm2 setf xpm2
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
NERDTree BufEnter
NERD_tree_*
stopinsert
Last set from ~/.vim/plugged/nerdtree/plugin/NERD_tree.vim
NERDTreeHijackNetrw BufEnter
* call nerdtree#checkForBrowse(expand("<amatch>"))
Last set from ~/.vim/plugged/nerdtree/plugin/NERD_tree.vim
NERDCommenter BufEnter
* :call s:SetUpForNewFiletype(&filetype, 0)
Last set from ~/.vim/plugged/nerdcommenter/plugin/NERD_commenter.vim
color_coded BufEnter
* call color_coded#enter()
Last set from ~/.vim/plugged/color_coded/plugin/color_coded.vim
delimitMate BufEnter
* if !exists('b:delimitMate_was_here') | call <SID>setup() | let b:delimitMate_was_here = 1 | endif
Last set from ~/.vim/plugged/delimitMate/plugin/delimitMate.vim
Vimball BufEnter
*.vba setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vba.gz setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vba.bz2 setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vba.zip setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vba.xz setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vmb setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vmb.gz setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vmb.bz2 setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vmb.zip setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
*.vmb.xz setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so
%)")|endif
Last set from /usr/local/Cellar/macvim/8.0-137_2/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
youcompleteme BufEnter
* call s:OnBufferEnter()
Last set from ~/.vim/plugged/YouCompleteMe/autoload/youcompleteme.vim
To debug this further, use the :profile command:
:profile start profile.log
:profile func *
:profile file *
" Do the slow operations here.
:profile pause
:qa!
then open the profile.log file created in the current directory and look for the top functions in the FUNCTIONS SORTED ON SELF TIME section.
My profile.log.
The ycm_state.HandleFileParseRequest() is too slow.
Try again with
let g:ycm_show_diagnostics_ui = 0
profile_again.log with let g:ycm_show_diagnostics_ui = 0.
Still slow.
The profile is dominated by color coded and airline.
Please can you repeat without these plugins enabled.
Repeat this problem, still slow but better than before. The ycm_state.HandleFileParseRequest() is too slow.
When I hit up/down key, the chosen completion candidate will show in editing line, at this time, YCM will parse source code?
I could reproduce the slowness when enabling the indentLine plugin. Looks like this plugin redraws indentation levels each time a new window is visited. As I said before, when Vim opens the preview window, it moves the cursor to this window then moves back to the current window. This triggers the WinEnter autocommand events twice: one for the preview window and another one for the current window. indentLine does not ignore the preview window so each time you press up or down to select a candidate in the completion menu, indentLine redraws the indentation levels for both windows, which causes the slowness. indentLine should not redraw at all in that scenario.
When I hit up/down key, the chosen completion candidate will show in editing line, at this time, YCM will parse source code?
No, it won't.
Thank you very much 馃槃
Most helpful comment
I could reproduce the slowness when enabling the
indentLineplugin. Looks like this plugin redraws indentation levels each time a new window is visited. As I said before, when Vim opens the preview window, it moves the cursor to this window then moves back to the current window. This triggers theWinEnterautocommand events twice: one for the preview window and another one for the current window.indentLinedoes not ignore the preview window so each time you press up or down to select a candidate in the completion menu,indentLineredraws the indentation levels for both windows, which causes the slowness.indentLineshould not redraw at all in that scenario.No, it won't.