MCPcopy Create free account
hub / github.com/acl-dev/acl / GetCompilationInfoForFile

Function GetCompilationInfoForFile

.ycm_extra_conf.py:141–156  ·  view source on GitHub ↗
( filename )

Source from the content-addressed store, hash-verified

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

Callers 1

FlagsForFileFunction · 0.85

Calls 2

IsHeaderFileFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…