forked from qt-creator/qt-creator
Clang: Fix sending (un)register translation unit
Handle the following use cases:
1. Editor is opened
--> Register file at backend.
2. Close editor for which a project part exists
--> Unregister file with project part.
3. Close editor for which no project part exists (anymore)
--> Unregister file with empty/default project part.
Change-Id: I2b253004a920cccef989876538ab552eacf6b45c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -63,13 +63,23 @@ public:
|
||||
CPlusPlus::Snapshot snapshot() override;
|
||||
bool isParserRunning() const override;
|
||||
|
||||
CppTools::ProjectPart::Ptr projectPart() const;
|
||||
|
||||
public:
|
||||
static ClangEditorDocumentProcessor *get(const QString &filePath);
|
||||
|
||||
private slots:
|
||||
void onParserFinished();
|
||||
void onProjectPartsRemoved(const QStringList &projectPartIds);
|
||||
|
||||
private:
|
||||
void updateProjectPartAndTranslationUnitForCompletion();
|
||||
void updateTranslationUnitForCompletion(CppTools::ProjectPart &projectPart);
|
||||
|
||||
QPointer<ModelManagerSupportClang> m_modelManagerSupport;
|
||||
|
||||
ClangEditorDocumentParser m_parser;
|
||||
CppTools::ProjectPart::Ptr m_projectPart;
|
||||
QFutureWatcher<void> m_parserWatcher;
|
||||
unsigned m_parserRevision;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user