ycm-core / YouCompleteMe

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

AttributeError when opening c or cpp files #3507

Closed tgys closed 4 years ago

tgys commented 4 years ago

I compiled YCM with go, typescript, rust, java, and semantic support for c languages through libclang (with system libclang version 9.0.0). I get the error AttributeError: module 'yrlnrxfcnjwvlso' has no attribute 'FlagsForFile' if I open a c or c++ file. I get a new error every time I open a file (even when it's the same file) where the only thing that changes is the module name, e.g jjbsgqwsznkcvuy

error logs: Traceback (most recent call last): File "/home/tei/.vim/bundles/YouCompleteMe/python/ycm/client/base_request.py", line 79, in HandleFuture return _JsonFromFuture( future ) File "/home/tei/.vim/bundles/YouCompleteMe/python/ycm/client/base_request.py", line 242, in _JsonFromFuture raise MakeServerException( response.json() ) ycmd.responses.ServerError: AttributeError: module 'ygjmwrqyobuiman' has no attribute 'FlagsForFile'

File "/home/tei/.vim/bundles/YouCompleteMe/third_party/ycmd/ycmd/completers/cpp/flags.py", line 185, in _GetFlagsFromExtraConfOrDatabase return _CallExtraConfFlagsForFile( module, filename, client_data ) File "/home/tei/.vim/bundles/YouCompleteMe/third_party/ycmd/ycmd/completers/cpp/flags.py", line 284, in _CallExtraConfFlagsForFile elif inspect.getargspec( module.FlagsForFile ).keywords: AttributeError: module 'ygjmwrqyobuiman' has no attribute 'FlagsForFile'

YcmDebugInfo output: Printing YouCompleteMe debug information... -- Client logfile: /tmp/ycm_3qz125mm.log -- Server Python interpreter: /usr/bin/python3 -- Server Python version: 3.7.4 -- Server has Clang support compiled in: True -- Clang version: clang version 8.0.0 (tags/RELEASE_800/final) -- Extra configuration file found and loaded -- Extra configuration path: /home/tei/.vim/bundles/YouCompleteMe/.ycm_extra_conf.py -- Server running at: http://127.0.0.1:33743 -- Server process ID: 656243 -- Server logfiles: -- /tmp/ycmd_33743_stdout_9j67meme.log -- /tmp/ycmd_33743_stderr_d4cag8g5.log

example program that gave those errors: `#include

include

include

include

include

using namespace std;

int main() { string a,b,c; cin >> a >> b >> c; const int sum3 = stoi(a) + stoi(b) + stoi(c); cout << sum3 << "\n"; return 0; }`

I am using archlinux 5.3.1 and VIM 8.1 with included features (+): +arabic +file_in_path +mouse_urxvt +tcl/dyn +autocmd +find_in_path +mouse_xterm +termguicolors +autochdir +float +multi_byte +terminal -autoservername +folding +multi_lang +terminfo -balloon_eval -footer -mzscheme +termresponse +balloon_eval_term +fork() +netbeans_intg +textobjects -browse +gettext +num64 +textprop ++builtin_terms -hangul_input +packages +timers +byte_offset +iconv +path_extra +title +channel +insert_expand +perl/dyn -toolbar +cindent +job +persistent_undo +user_commands -clientserver +jumplist +postscript +vartabs -clipboard +keymap +printer +vertsplit +cmdline_compl +lambda +profile +virtualedit +cmdline_hist +langmap +python/dyn +visual +cmdline_info +libcall +python3/dyn +visualextra +comments +linebreak +quickfix +viminfo +conceal +lispindent +reltime +vreplace +cryptv +listcmds +rightleft +wildignore +cscope +localmap +ruby/dyn +wildmenu +cursorbind +lua/dyn +scrollbind +windows +cursorshape +menu +signs +writebackup +dialog_con +mksession +smartindent -X11 +diff +modify_fname -sound -xfontset +digraphs +mouse +spell -xim -dnd -mouseshape +startuptime -xpm -ebcdic +mouse_dec +statusline -xsmp +emacs_tags +mouse_gpm -sun_workshop -xterm_clipboard +eval -mouse_jsbterm +syntax -xterm_save +ex_extra +mouse_netterm +tag_binary +extra_search +mouse_sgr -tag_old_static

bstaletic commented 4 years ago

What's in your .ycm_extra_conf.py? This is definitely user error, though it's not at all obvious to a user what the error is. My suggestion is to go over to https://gitter.im/Valloric/YouCompleteMe and chat with us there.

bstaletic commented 4 years ago

Resolved on gitter, therefore closing.