forked from qt-creator/qt-creator
Clang: Fix delayed reparse of dirty and visible but not current documents
1. Open document foo.h
2. Create a split and open foo.cpp (#including "foo.h")
3. Edit foo.h (e.g. by introducing a syntax error, so that foo.cpp will
indicate header errors in the toolbar or as info bar)
=> Actual: foo.cpp will be reparsed immediately.
Expected: foo.cpp should be reparsed after a delay.
This saves resources (cpu time) and minimizes poping up of the header
info bar while editing header files in splits.
Regression introduced by
commit 380d756a03
Clang: Hook up supportive translation unit on first edit
Change-Id: Ib5fd90e49415dfc3aefacab7cd627b0e1937f5fc
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
#include <skippedsourceranges.h>
|
||||
#include <unsavedfiles.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <algorithm>
|
||||
@@ -143,6 +145,20 @@ const std::vector<Document> &Documents::documents() const
|
||||
return documents_;
|
||||
}
|
||||
|
||||
const std::vector<Document> Documents::filtered(const IsMatchingDocument &isMatchingDocument) const
|
||||
{
|
||||
return Utils::filtered(documents_, isMatchingDocument);
|
||||
}
|
||||
|
||||
std::vector<Document> Documents::dirtyAndVisibleButNotCurrentDocuments() const
|
||||
{
|
||||
return filtered([](const Document &document) {
|
||||
return document.isNeedingReparse()
|
||||
&& document.isVisibleInEditor()
|
||||
&& !document.isUsedByCurrentEditor();
|
||||
});
|
||||
}
|
||||
|
||||
UnsavedFiles Documents::unsavedFiles() const
|
||||
{
|
||||
return unsavedFiles_;
|
||||
|
||||
Reference in New Issue
Block a user