MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / GetCompilationInfoForFile

Function GetCompilationInfoForFile

scripts/linux/ycm_extra_conf.py:112–127  ·  view source on GitHub ↗
( filename )

Source from the content-addressed store, hash-verified

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

Callers 1

FlagsForFileFunction · 0.70

Calls 2

IsHeaderFileFunction · 0.70
existsMethod · 0.45

Tested by

no test coverage detected