MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / GetCompilationInfoForFile

Function GetCompilationInfoForFile

.ycm_extra_conf.py:148–163  ·  view source on GitHub ↗
( filename )

Source from the content-addressed store, hash-verified

146
147
148def GetCompilationInfoForFile( filename ):
149 # The compilation_commands.json file generated by CMake does not have entries
150 # for header files. So we do our best by asking the db for flags for a
151 # corresponding source file, if any. If one exists, the flags for that file
152 # should be good enough.
153 if IsHeaderFile( filename ):
154 basename = os.path.splitext( filename )[ 0 ]
155 for extension in SOURCE_EXTENSIONS:
156 replacement_file = basename + extension
157 if os.path.exists( replacement_file ):
158 compilation_info = database.GetCompilationInfoForFile(
159 replacement_file )
160 if compilation_info.compiler_flags_:
161 return compilation_info
162 return None
163 return database.GetCompilationInfoForFile( filename )
164
165
166def FlagsForFile( filename, **kwargs ):

Callers 1

FlagsForFileFunction · 0.85

Calls 1

IsHeaderFileFunction · 0.85

Tested by

no test coverage detected