diff --git a/README.md b/README.md index eaa6637d..798454a9 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ TODO, still WIP plugin. It has support for YCM and together they will provide you with compile errors/warnings practically instantly and without saving the file. -YCM looks for a `.ycm_clang_options.py` file in the directory of the opened file +YCM looks for a `.ycm_extra_conf.py` file in the directory of the opened file or in any directory above it in the hierarchy (recursively); when the file is found, it is loaded (only once!) as a Python module. YCM calls a `FlagsForFile` method in that module which should provide it with the information necessary to @@ -246,7 +246,7 @@ This system was designed this way so that the user can perform any arbitrary sequence of operations to produce a list of compilation flags YCM should hand to Clang. -[See YCM's own `.ycm_clang_options.py`][flags_example] for details on how this +[See YCM's own `.ycm_extra_conf.py`][flags_example] for details on how this works. You should be able to use it as a starting point. Hint: just replace the strings in the `flags` variable with compilation flags necessary for your project. That should be enough for 99% of projects. @@ -254,7 +254,7 @@ project. That should be enough for 99% of projects. Yes, [Clang's `CompilationDatabase` system][compdb] is also supported. Again, see the above linked example file. -TODO: compile flags, include paths, ycm_clang_options, CompilationDatabase +TODO: compile flags, include paths, ycm_extra_conf, CompilationDatabase support, how the search system works (subsequence match), extending the semantic engine for other langs, using ListToggle @@ -413,5 +413,5 @@ This software is licensed under the [GPL v3 license][gpl]. [gpl]: http://www.gnu.org/copyleft/gpl.html [vim]: http://www.vim.org/ [syntastic]: https://github.com/scrooloose/syntastic -[flags_example]: https://github.com/Valloric/YouCompleteMe/blob/master/cpp/ycm/.ycm_clang_options.py +[flags_example]: https://github.com/Valloric/YouCompleteMe/blob/master/cpp/ycm/.ycm_extra_conf.py [compdb]: http://clang.llvm.org/docs/JSONCompilationDatabase.html diff --git a/cpp/ycm/.ycm_clang_options.py b/cpp/ycm/.ycm_extra_conf.py similarity index 98% rename from cpp/ycm/.ycm_clang_options.py rename to cpp/ycm/.ycm_extra_conf.py index 896f5fcd..f418f016 100644 --- a/cpp/ycm/.ycm_clang_options.py +++ b/cpp/ycm/.ycm_extra_conf.py @@ -110,7 +110,7 @@ def FlagsForFile( filename ): # NOTE: This is just for YouCompleteMe; it's highly likely that your project # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR - # ycm_clang_options IF YOU'RE NOT 100% YOU NEED IT. + # ycm_extra_conf IF YOU'RE NOT 100% YOU NEED IT. try: final_flags.remove( '-stdlib=libc++' ) except ValueError: diff --git a/python/completers/cpp/flags.py b/python/completers/cpp/flags.py index 6f385e20..78642035 100644 --- a/python/completers/cpp/flags.py +++ b/python/completers/cpp/flags.py @@ -25,10 +25,10 @@ import string import sys import vimsupport -CLANG_OPTIONS_FILENAME = '.ycm_clang_options.py' +YCM_EXTRA_CONF_FILENAME = '.ycm_extra_conf.py' NO_OPTIONS_FILENAME_MESSAGE = ('No {0} file detected, so no compile flags ' 'are available. Thus no semantic support for C/C++/ObjC/ObjC++.').format( - CLANG_OPTIONS_FILENAME ) + YCM_EXTRA_CONF_FILENAME ) class Flags( object ): def __init__( self ): @@ -86,15 +86,15 @@ class Flags( object ): def _FlagsModuleSourceFileForFile( filename ): - """For a given filename, finds its nearest CLANG_OPTIONS_FILENAME file that + """For a given filename, finds its nearest YCM_EXTRA_CONF_FILENAME file that will compute the flags necessary to compile the file. Returns None if no - CLANG_OPTIONS_FILENAME file could be found.""" + YCM_EXTRA_CONF_FILENAME file could be found.""" parent_folder = os.path.dirname( filename ) old_parent_folder = '' while True: - current_file = os.path.join( parent_folder, CLANG_OPTIONS_FILENAME ) + current_file = os.path.join( parent_folder, YCM_EXTRA_CONF_FILENAME ) if os.path.exists( current_file ): return current_file