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

Function GetCompilationInfoForFile

scripts/osx/ycm_extra_conf.py:116–131  ·  view source on GitHub ↗
( filename )

Source from the content-addressed store, hash-verified

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

Callers 1

FlagsForFileFunction · 0.70

Calls 2

IsHeaderFileFunction · 0.70
existsMethod · 0.45

Tested by

no test coverage detected