void UpdateExtraDocumentAnnotationsJob::finalizeAsyncRun()
{
    if (context().isOutdated())
        return;

    context().client->documentAnnotationsChanged(
                DocumentAnnotationsChangedMessage(m_pinnedFileContainer, asyncResult()));
}
Exemple #2
0
void ClangCodeModelServer::requestDocumentAnnotations(const RequestDocumentAnnotationsMessage &message)
{
    TIME_SCOPE_DURATION("ClangCodeModelServer::requestDocumentAnnotations");

    try {
        auto translationUnit = translationUnits.translationUnit(message.fileContainer().filePath(),
                               message.fileContainer().projectPartId());

        client()->documentAnnotationsChanged(DocumentAnnotationsChangedMessage(translationUnit.fileContainer(),
                                             translationUnit.mainFileDiagnostics(),
                                             translationUnit.highlightingMarks().toHighlightingMarksContainers(),
                                             translationUnit.skippedSourceRanges().toSourceRangeContainers()));
    } catch (const TranslationUnitDoesNotExistException &exception) {
        client()->translationUnitDoesNotExist(TranslationUnitDoesNotExistMessage(exception.fileContainer()));
    } catch (const ProjectPartDoNotExistException &exception) {
        client()->projectPartsDoNotExist(ProjectPartsDoNotExistMessage(exception.projectPartIds()));
    }  catch (const std::exception &exception) {
        qWarning() << "Error in ClangCodeModelServer::requestDocumentAnnotations:" << exception.what();
    }
}