MCPcopy Create free account
hub / github.com/Taywee/args / GetCompilationInfoForFile

Function GetCompilationInfoForFile

.ycm_extra_conf.py:106–121  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

104 return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
105
106def GetCompilationInfoForFile(filename):
107 # The compilation_commands.json file generated by CMake does not have entries
108 # for header files. So we do our best by asking the db for flags for a
109 # corresponding source file, if any. If one exists, the flags for that file
110 # should be good enough.
111 if IsHeaderFile( filename ):
112 basename = os.path.splitext( filename )[ 0 ]
113 for extension in SOURCE_EXTENSIONS:
114 replacement_file = basename + extension
115 if os.path.exists( replacement_file ):
116 compilation_info = database.GetCompilationInfoForFile(
117 replacement_file )
118 if compilation_info.compiler_flags_:
119 return compilation_info
120 return None
121 return database.GetCompilationInfoForFile(filename)
122
123
124def FlagsForFile( filename, **kwargs ):

Callers 1

FlagsForFileFunction · 0.85

Calls 1

IsHeaderFileFunction · 0.85

Tested by

no test coverage detected