From e17be2f81c83fcaa5d8eeed925b6d718e38712b2 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Wed, 2 Apr 2014 15:41:48 -0700 Subject: [PATCH] Revert "Don't pass extra include path to libclang" This reverts commit 7bdff8941c1bcb8df3badbef403927211cb3391a. --- python/ycm/completers/cpp/flags.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/ycm/completers/cpp/flags.py b/python/ycm/completers/cpp/flags.py index 2b83fd71..c2e4377f 100644 --- a/python/ycm/completers/cpp/flags.py +++ b/python/ycm/completers/cpp/flags.py @@ -35,11 +35,13 @@ class Flags( object ): def __init__( self ): # It's caches all the way down... self.flags_for_file = {} + self.special_clang_flags = _SpecialClangIncludes() self.no_extra_conf_file_warning_posted = False def FlagsForFile( self, filename, + add_special_clang_flags = True, client_data = None ): try: return self.flags_for_file[ filename ] @@ -62,6 +64,8 @@ class Flags( object ): if not flags: return None + if add_special_clang_flags: + flags += self.special_clang_flags sanitized_flags = PrepareFlagsForClang( flags, filename ) if results[ 'do_cache' ]: @@ -194,5 +198,9 @@ def _RemoveUnusedFlags( flags, filename ): return new_flags +def _SpecialClangIncludes(): + libclang_dir = os.path.dirname( ycm_core.__file__ ) + path_to_includes = os.path.join( libclang_dir, 'clang_includes' ) + return [ '-isystem', path_to_includes ]