(filename, **kwargs)
| 127 | # This is the entry point; this function is called by ycmd to produce flags for |
| 128 | # a file. |
| 129 | def FlagsForFile(filename, **kwargs): |
| 130 | final_flags = [] |
| 131 | if database: |
| 132 | # Bear in mind that compilation_info.compiler_flags_ does NOT return a |
| 133 | # python list, but a "list-like" StringVec object |
| 134 | compilation_info = GetCompilationInfoForFile(filename) |
| 135 | if not compilation_info: |
| 136 | return None |
| 137 | |
| 138 | final_flags = MakeRelativePathsInFlagsAbsolute( |
| 139 | compilation_info.compiler_flags_, |
| 140 | compilation_info.compiler_working_dir_) |
| 141 | |
| 142 | final_flags = final_flags + MakeRelativePathsInFlagsAbsolute(flags) |
| 143 | # caused by database do not generate database for cuh or h file, which may include file abspath files |
| 144 | final_flags = final_flags + [ |
| 145 | "-I{}".format(os.path.dirname(os.path.abspath(filename))) |
| 146 | ] |
| 147 | |
| 148 | return {"flags": final_flags, "do_cache": True} |
| 149 | |
| 150 | |
| 151 | def Settings(filename, **kwargs): |
no test coverage detected