[kdevelop/5.0] languages/clang: Hopefully fix screwed-up clang higlighting.
Sven Brauch
mail at svenbrauch.de
Wed Jul 20 22:36:07 UTC 2016
Git commit 5d076e29438261f3b70b633fd79551a50f0e9ef6 by Sven Brauch.
Committed on 20/07/2016 at 22:34.
Pushed by brauch into branch '5.0'.
Hopefully fix screwed-up clang higlighting.
If you see this happening again, please tell me.
Make sure to also update kdevplatform.
CCMAIL:kdevelop-devel at kde.org
REVIEW:128480
The issue was that the clang plugin wouldn't store the modification
revision for files which were marked as "not modified" by KTextEditor.
Thus, no translation of the highlighting to the new state could be
performed for those documents. This is wrong, since a document can
be "not modified", but can still have changed in the time between the
start of the parse job start and end, etc. Just imagine you
press save after each character typed.
M +3 -1 languages/clang/clangparsejob.cpp
http://commits.kde.org/kdevelop/5d076e29438261f3b70b633fd79551a50f0e9ef6
diff --git a/languages/clang/clangparsejob.cpp b/languages/clang/clangparsejob.cpp
index 8375eb5..d676aea 100644
--- a/languages/clang/clangparsejob.cpp
+++ b/languages/clang/clangparsejob.cpp
@@ -189,7 +189,9 @@ ClangParseJob::ClangParseJob(const IndexedString& url, ILanguageSupport* languag
foreach(auto document, ICore::self()->documentController()->openDocuments()) {
auto textDocument = document->textDocument();
- if (!textDocument || !textDocument->isModified() || !textDocument->url().isLocalFile()
+ // TODO: Introduce a cache so we don't have to re-read all the open documents
+ // which were not changed since the last run
+ if (!textDocument || !textDocument->url().isLocalFile()
|| !DocumentFinderHelpers::mimeTypesList().contains(textDocument->mimeType()))
{
continue;
More information about the KDevelop-devel
mailing list