MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / GetCompilationInfoForFile

Function GetCompilationInfoForFile

.ycm_extra_conf.py:35–50  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

33
34
35def GetCompilationInfoForFile(filename):
36 # The compilation_commands.json file generated by CMake does not have entries
37 # for header files. So we do our best by asking the db for flags for a
38 # corresponding source file, if any. If one exists, the flags for that file
39 # should be good enough.
40 if IsHeaderFile(filename):
41 basename = os.path.splitext(filename)[0]
42 for extension in SOURCE_EXTENSIONS:
43 replacement_file = basename + extension
44 if os.path.exists(replacement_file):
45 compilation_info = database.GetCompilationInfoForFile(
46 replacement_file)
47 if compilation_info.compiler_flags_:
48 return compilation_info
49 return None
50 return database.GetCompilationInfoForFile(filename)
51
52
53# This is the entry point; this function is called by ycmd to produce flags for

Callers 1

FlagsForFileFunction · 0.85

Calls 2

IsHeaderFileFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected