New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'module' object has no attribute 'FlagsForFile' #2249
Comments
Please see CONTRIBUTING.md. In particular, please carefully read README.md sections on c-family semantic completions. |
So the answer seems to be "you need to recompile YCM", which saddens me. Somehow, YCM goes broke sometimes and doesn't provide a proper user interface that tells the user what to do. Instead a cryptic debug-message is shown. End of rant ^^ |
@johannes87 Unless you faced a completely unrelated problem, the solution is to provide a valid extra conf file, which is described in detail in the README. |
In addition when recompilationnis required that’s exactly what the message says. ^^ end reasonable explanation. |
Here my import os
import ycm_core
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-ferror-limit=10000',
'-DNDEBUG',
'-std=c99',
'-xc',
'-isystem/usr/include/',
]
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', ]
def FlagsForFile( filename, **kwargs ):
return {
'flags': flags,
'do_cache': True
} Simple clang completion like struct/functions, works well for me. Bring this file to |
Wait, I'm confused, the README says that it calls a function called |
The docs are the primary reference, and legacy/potentially misleading posts on the issue tracker are not going to remain current. If you feel the documentation is unclear, or lacking, feel free to head to Gitter and discuss or send a PR to correct or update it. Not reading it is not really an excuse. |
Noob mistake, my bad. Thanks for the prompt reply. |
@puremourning I'd like to suggest that by default a warning is shown when starting vim, if a ycm_extra_conf.py file is loaded which has a |
FlagsForFile works fine. There’s no likelihood that will change. So warning is not necessary. We could however include an explanation of the historical interface in the docs. PRs are welcome 🙏 |
Also how can we be held to ransom by ‘publicly available’ stuff that’s nothing to do with is? if you read the docs and still struggle we’re always willing to provide help and support. We can’t endorse any inaccurate or outdated third party advice or examples. |
Ubuntu 14.04(64bit)
When I want to use the :YcmCompleter :YcmCompleter GoToDefinition command, the following occurs
AttributeError: 'module' object has no attribute 'FlagsForFile' .(.c file)
Note:(./install.py --clang-completer) has been successfully installed
The text was updated successfully, but these errors were encountered: