forked from qt-creator/qt-creator
Clang: Add UpdateTranslationUnitsForEditorMessage
If an editor is changing all translation units independent of their project part they must be updated too. So we introduce a new message to update all translation units with the same file path. Change-Id: I70d0ea2bbca9fa880111ff7219573e54f3277026 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
|
||||
#include "clangutils.h"
|
||||
|
||||
#include "clangeditordocumentprocessor.h"
|
||||
|
||||
#include <clang-c/Index.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -264,6 +266,13 @@ ProjectPart::Ptr projectPartForFile(const QString &filePath)
|
||||
return ProjectPart::Ptr();
|
||||
}
|
||||
|
||||
ProjectPart::Ptr projectPartForFileBasedOnProcessor(const QString &filePath)
|
||||
{
|
||||
if (const auto processor = ClangEditorDocumentProcessor::get(filePath))
|
||||
return processor->projectPart();
|
||||
return ProjectPart::Ptr();
|
||||
}
|
||||
|
||||
bool isProjectPartValid(const ProjectPart::Ptr projectPart)
|
||||
{
|
||||
if (projectPart)
|
||||
|
||||
Reference in New Issue
Block a user