Clang: Request diagnostics/highlighting only if needed

Most of the time, the updated diagnostics/highlightings will be send by
the backend on translation unit update.

The other use case is changing the font settings (e.g. color), here we
need to request the highlightings explicitly.

Change-Id: I17a574eaf972c8bef12900241e7b33fe6ffd9dbd
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-11-30 10:55:25 +01:00
parent 514a96c75f
commit a12a8c95f9
5 changed files with 58 additions and 73 deletions

View File

@@ -193,7 +193,7 @@ void ModelManagerSupportClang::onCppDocumentReloadFinishedOnTranslationUnit(bool
if (success) {
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender());
connectToTextDocumentContentsChangedForTranslationUnit(textDocument);
m_ipcCommunicator.requestDiagnosticsAndHighlighting(textDocument);
m_ipcCommunicator.updateTranslationUnitWithRevisionCheck(textDocument);
}
}
@@ -342,7 +342,7 @@ void ModelManagerSupportClang::unregisterTranslationUnitsWithProjectParts(
{
const auto processors = clangProcessorsWithProjectParts(projectPartIds);
foreach (ClangEditorDocumentProcessor *processor, processors) {
m_ipcCommunicator.unregisterTranslationUnitsForEditor({processor->fileContainer()});
m_ipcCommunicator.unregisterTranslationUnitsForEditor({processor->fileContainerWithArguments()});
processor->clearProjectPart();
processor->run();
}