ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.46k stars 2.81k forks source link

YcmDiags and FixIt prints errors. #2646

Closed DasOhmoff closed 7 years ago

DasOhmoff commented 7 years ago

Hi.

When I try to open the YcmDiags window, for example when I have this error int x = 0 (no semicolon at the end). I get an error message:

Diagnostics refreshed Error detected while processing function 122_ShowDiagnostics: line 1: Traceback (most recent call last): File "", line 1, in File "/home/dasohmoff/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 759, in ShowDiagnostics vimsupport.OpenLocationList( focus = True ) File "/home/dasohmoff/.vim/bundle/YouCompleteMe/autoload/../python/ycm/vimsupport.py", line 267, in OpenLocationList vim.command( 'botright lopen' ) vim.error: Vim(loadview):E32: No file name

After I press enter to accept the message it actually openes the YcmDiags window with the correct error message in it.

Another thing is when I try to use the FixIt feature of YouCompleteMe, it prints some errors too. For example when I miss a semicolon again (int x = 0), I get this messageexpected ';' at end of declaration (FixIt), so I try to use the :FixIt feature and this Error gets printed:

Error detected while processing function 122_CompleterCommand: line 18: Traceback (most recent call last): File "", line 1, in File "/home/dasohmoff/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py", line 307, in SendCommandRequest return SendCommandRequest( arguments, completer, extra_data ) File "/home/dasohmoff/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/command_request.py", line 138, in SendCommandRequest request.RunPostCommandActionsIfNeeded() File "/home/dasohmoff/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/command_request.py", line 75, in RunPostCommandActionsIfNeeded return self._HandleFixitResponse() File "/home/dasohmoff/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/command_request.py", line 117, in _HandleFixitResponse self._response[ 'fixits' ][ fixit_index ][ 'chunks' ] ) File "/home/dasohmoff/.vim/bundle/YouCompleteMe/autoload/../python/ycm/vimsupport.py", line 758, in ReplaceChunks OpenQuickFixList() File "/home/dasohmoff/.vim/bundle/YouCompleteMe/autoload/../python/ycm/vimsupport.py", line 294, in OpenQuickFixList vim.command( 'botright copen' ) vim.error: Vim(loadview):E32: No file name

After I press enter the error get fixed, so in this case it puts a semicolon at the end. Also a window showing the fixes pops up. How do I fix those errors?

vim --version:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled May 03 2017 12:11:53) Included patches: 1-313, 315-596 Modified by pkg-vim-maintainers@lists.alioth.debian.org Compiled by pkg-vim-maintainers@lists.alioth.debian.org Huge version with GTK2 GUI. Features included (+) or not (-): +acl +file_in_path +mouse_sgr +tag_old_static +arabic +find_in_path -mouse_sysmouse -tag_any_white +autocmd +float +mouse_urxvt +tcl +balloon_eval +folding +mouse_xterm +termguicolors +browse -footer +multi_byte +terminfo ++builtin_terms +fork() +multi_lang +termresponse +byte_offset +gettext -mzscheme +textobjects +channel -hangul_input +netbeans_intg +timers +cindent +iconv +num64 +title +clientserver +insert_expand +packages +toolbar +clipboard +job +path_extra +user_commands +cmdline_compl +jumplist +perl +vertsplit +cmdline_hist +keymap +persistent_undo +virtualedit +cmdline_info +lambda +postscript +visual +comments +langmap +printer +visualextra +conceal +libcall +profile +viminfo +cryptv +linebreak -python +vreplace +cscope +lispindent +python3 +wildignore +cursorbind +listcmds +quickfix +wildmenu +cursorshape +localmap +reltime +windows +dialog_con_gui +lua +rightleft +writebackup +diff +menu +ruby +X11 +digraphs +mksession +scrollbind -xfontset +dnd +modify_fname +signs +xim -ebcdic +mouse +smartindent +xpm +emacs_tags +mouseshape +startuptime +xsmp_interact +eval +mouse_dec +statusline +xterm_clipboard +ex_extra +mouse_gpm -sun_workshop -xterm_save +extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
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: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -Wdate-time -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.2 -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -lm -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm

Output of YcmDebugInfo

Printing YouCompleteMe debug information... -- Client logfile: /tmp/ycm_r1zgpgds.log -- Server Python interpreter: /usr/bin/python3 -- Server Python version: 3.5.2 -- Server has Clang support compiled in: True -- Clang version: clang version 4.0.0 (tags/RELEASE_400/final) -- Extra configuration file found and loaded -- Extra configuration path: /home/dasohmoff/.vim/.ycm_extra_conf.py -- C-family completer debug information: -- Compilation database path: None -- Flags: ['-Wall', '-Wextra', '-Werror', '-Wno-long-long', '-Wno-variadic-macros', '-fexceptions', '-fmax-errors=15', '-DNDEBUG', '-DUNIT_TESTS', '-std=c++11', '-lsfml-graphics', '-lsfml-window', '-lsfml-syst em', '-lsfml-audio', '-lsfml-network', '-lsfgui', '-lthor', '-xc++', '-I/usr/include/c++/6.2.0', '-I/usr/local/include', '-resource-dir=/home/dasohmoff/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../clang_in cludes', '-fspell-checking'] -- Server running at: http://127.0.0.1:39048 -- Server process ID: 16159 -- Server logfiles: -- /tmp/ycmd_39048_stdout_4muuvmw8.log -- /tmp/ycmd_39048_stderr_jtxrj4wt.log

Installation output:

Searching Python 2.7 libraries... Found Python library: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so Found Python headers folder: /usr/include/python2.7 -- The C compiler identification is GNU 6.2.0 -- The CXX compiler identification is GNU 6.2.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonLibs: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.6") Using Clang archive: /home/dasohmoff/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/../clang_archives/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz Using libclang to provide semantic completion for C/C++/ObjC Using external libclang: /tmp/ycm_build_v7elWO/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-14.04/lib/libclang.so.4 -- Found PythonInterp: /usr/bin/python2.7 (found version "2.7.12") -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Configuring done -- Generating done -- Build files have been written to: /tmp/ycm_build_v7elWO Scanning dependencies of target BoostParts [ 0%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/dict.cpp.o [ 1%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/module.cpp.o [ 2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/errors.cpp.o [ 2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/long.cpp.o [ 2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/list.cpp.o [ 3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/wrapper.cpp.o [ 4%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object_protocol.cpp.o [ 5%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object_operators.cpp.o [ 5%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/exec.cpp.o [ 7%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/tuple.cpp.o [ 8%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/import.cpp.o [ 8%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/class.cpp.o [ 9%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/inheritance.cpp.o [ 9%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/enum.cpp.o [ 10%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/stl_iterator.cpp.o [ 11%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/pickle_support.cpp.o [ 11%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/iterator.cpp.o [ 13%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/function_doc_signature.cpp.o [ 14%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/life_support.cpp.o [ 14%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/function.cpp.o [ 15%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/registry.cpp.o [ 15%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/from_python.cpp.o [ 16%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/slice.cpp.o [ 17%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/numeric.cpp.o [ 17%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/builtin_converters.cpp.o [ 19%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/arg_to_python_base.cpp.o [ 20%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/type_id.cpp.o [ 21%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/system/src/error_code.cpp.o [ 21%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/str.cpp.o [ 22%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/atomic/src/lockpool.cpp.o [ 22%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/text_iarchive.cpp.o [ 23%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/binary_oarchive.cpp.o [ 25%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/extended_type_info.cpp.o [ 25%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/polymorphic_iarchive.cpp.o [ 26%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_xml_archive.cpp.o [ 26%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_iserializer.cpp.o [ 27%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_oarchive.cpp.o [ 28%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/stl_port.cpp.o [ 28%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/extended_type_info_no_rtti.cpp.o [ 29%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/utf8_codecvt_facet.cpp.o [ 30%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/text_oarchive.cpp.o [ 30%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/void_cast.cpp.o [ 32%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/polymorphic_oarchive.cpp.o [ 33%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/text_woarchive.cpp.o [ 33%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_text_wiprimitive.cpp.o [ 34%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/binary_iarchive.cpp.o [ 34%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_text_oprimitive.cpp.o [ 35%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/text_wiarchive.cpp.o [ 36%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/binary_woarchive.cpp.o [ 36%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_pointer_oserializer.cpp.o [ 38%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/binary_wiarchive.cpp.o [ 39%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/archive_exception.cpp.o [ 39%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/codecvt_null.cpp.o [ 40%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_oserializer.cpp.o [ 41%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_pointer_iserializer.cpp.o [ 41%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/extended_type_info_typeid.cpp.o [ 42%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_wgrammar.cpp.o [ 42%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/singleton.cpp.o [ 44%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_archive_exception.cpp.o [ 45%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_text_woprimitive.cpp.o [ 45%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_wiarchive.cpp.o [ 46%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_text_iprimitive.cpp.o [ 47%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_iarchive.cpp.o [ 47%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_iarchive.cpp.o [ 48%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_grammar.cpp.o [ 50%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_serializer_map.cpp.o [ 50%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_oarchive.cpp.o [ 51%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_archive.cpp.o [ 51%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/timer/src/auto_timers_construction.cpp.o [ 52%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/timer/src/cpu_timer.cpp.o [ 53%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/windows_file_codecvt.cpp.o [ 53%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/utf8_codecvt_facet.cpp.o [ 54%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/unique_path.cpp.o [ 55%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path_traits.cpp.o [ 55%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/portability.cpp.o [ 57%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/codecvt_error_category.cpp.o [ 58%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path.cpp.o [ 59%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/greg_month.cpp.o [ 59%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/operations.cpp.o [ 59%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/gregorian_types.cpp.o [ 60%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/greg_weekday.cpp.o [ 61%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/date_generators.cpp.o [ 61%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/posix_time/posix_time_types.cpp.o [ 63%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/chrono/src/chrono.cpp.o [ 64%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/chrono/src/thread_clock.cpp.o [ 64%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/chrono/src/process_cpu_clocks.cpp.o [ 65%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/exception/src/clone_current_exception_non_intrusive.cpp.o [ 66%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/smart_ptr/src/sp_debug_hooks.cpp.o [ 66%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/smart_ptr/src/sp_collector.cpp.o [ 67%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/winstances.cpp.o [ 67%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/fileiter.cpp.o [ 69%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_traits_defaults.cpp.o [ 70%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/w32_regex_traits.cpp.o [ 70%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/instances.cpp.o [ 71%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/usinstances.cpp.o [ 72%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/icu.cpp.o [ 72%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/wide_posix_api.cpp.o [ 73%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/posix_api.cpp.o [ 75%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_raw_buffer.cpp.o [ 75%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/wc_regex_traits.cpp.o [ 76%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_debug.cpp.o [ 76%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/cpp_regex_traits.cpp.o [ 77%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/static_mutex.cpp.o [ 78%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/c_regex_traits.cpp.o [ 78%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/cregex.cpp.o [ 79%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex.cpp.o [ 80%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/thread/src/future.cpp.o [ 80%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/thread/src/pthread/once.cpp.o [ 82%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/thread/src/pthread/once_atomic.cpp.o [ 83%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/thread/src/pthread/thread.cpp.o [ 83%] Linking CXX static library libBoostParts.a [ 83%] Built target BoostParts Scanning dependencies of target ycm_core [ 84%] Building CXX object ycm/CMakeFiles/ycm_core.dir/versioning.cpp.o [ 84%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Result.cpp.o [ 85%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o [ 85%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/Range.cpp.o [ 86%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierCompleter.cpp.o [ 88%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangCompleter.cpp.o [ 89%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnit.cpp.o [ 90%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/Documentation.cpp.o [ 90%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/TranslationUnitStore.cpp.o [ 91%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/CompilationDatabase.cpp.o [ 91%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/CompletionData.cpp.o [ 92%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangUtils.cpp.o [ 92%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangHelpers.cpp.o [ 94%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o [ 95%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierDatabase.cpp.o [ 95%] Building CXX object ycm/CMakeFiles/ycm_core.dir/PythonSupport.cpp.o [ 96%] Building CXX object ycm/CMakeFiles/ycm_core.dir/LetterNodeListMap.cpp.o [ 97%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o [ 97%] Building CXX object ycm/CMakeFiles/ycm_core.dir/LetterNode.cpp.o [ 98%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CandidateRepository.cpp.o [100%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Candidate.cpp.o [100%] Linking CXX shared library /home/dasohmoff/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so [100%] Built target ycm_core

By the way it doesn't matter if I install YCM with python3 or not, same result.

I really appreciate your help, thank you.

puremourning commented 7 years ago

Thanks for the report, but could you list the exact steps you take to reproduce this, including an example file? Could you also let us know the output of the following commands within Vim:

:set autowrite? :set autowriteall?

I had a theory that it would be because the buffer had no name (e.g. after :enew and auto write was trying to save the file), though I cannot reproduce, so you'll need to list the exact steps we can follow to reproduce. Thanks.

DasOhmoff commented 7 years ago

Hi, thanks for your answer. I was trying to reproduce the error step by step, so I emptied my vimrc first. The error was gone. After some time deleting my vimrc commands and testing I found the command that creates the error: au BufWinEnter ?* silent loadview 1.

I copied those commands from the web to recover my folded code when I reopen the files:

au BufWinLeave ? mkview 1 au BufWinEnter ? silent loadview 1

So without the second line there is no error. I am really not a experienced vim user, so ist there a way to reopen files with their folds without getting this ycm error?

And another question, is there a way to use FixIt without the quickfix window popping up?

Thank you very much.

micbou commented 7 years ago

ist there a way to reopen files with their folds without getting this ycm error?

You can suppress the errors with silent!:

au BufWinLeave ?* silent! mkview 1
au BufWinEnter ?* silent! loadview 1

And another question, is there a way to use FixIt without the quickfix window popping up?

Yes, by calling cclose on the YcmQuickFixOpened autocommand:

autocmd User YcmQuickFixOpened cclose
DasOhmoff commented 7 years ago

Hi, thanks for your answer.

You can suppress the errors with silent!

That would work, but it would not really "fix" the errors, which is why I think there might be a better solution.

autocmd User YcmQuickFixOpened cclose

Nice! That really works well.

Thanks a lot.

micbou commented 7 years ago

That would work, but it would not really "fix" the errors, which is why I think there might be a better solution.

You could try:

au BufWinLeave ?* if !empty(bufname('%')) | mkview 1 | endif
au BufWinEnter ?* if !empty(bufname('%')) | silent loadview 1 | end

This checks if the current buffer has a name before running the mkview and loadview commands. I would still recommend to suppress these errors as they may happen in other situations and are rather harmless.

Anyway, closing as not a YCM issue.