INNER CODE UNIT · Python

IsHeaderFile

mongodb/mongo-cxx-driver · .ycm_extra_conf.py:109

def IsHeaderFile(filename):
    extension = os.path.splitext(filename)[1]
    return extension in ['.h', '.hxx', '.hpp', '.hh']


def GetCompilationInfoForFile(filename):
    # The compilation_commands.json file generated by CMake does not have
    # entries for header files. So we do our best by asking the db for flags
    # for a corresponding source file, if any. If one exists, the flags for
    # that file should be good enough.
    if IsHeaderFile(filename):
        basename = os.path.splitext(filename)[0]

        for extension in SOURCE_EXTENSIONS:
            replacement_file = basename + extension

            if os.path.exists(replacement_file):
                compilation_info = database.GetCompilationInfoForFile(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…