From d4bb5033b251e8afb612158011ebd89082664345 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 19 Jan 2015 13:14:45 +0100 Subject: CppTools: Remove separate indexing revision For indexing we used a custom revision that was updated on each modelManager BuiltinIndexingSupport::refreshSourceFiles() call. This could lead to rejection of updated documents triggered by refactoring actions, like for the following case: 1. Open a project containing a.h and a.cpp 2. Open a.cpp, insert some new lines, save and close the document 3. Open a.h and rename a function that is defined in a.cpp --> The refactoring action modifies a.h and a.cpp, so re-indexing of those is triggered. Since a.cpp has already a higher revision (step 2) than the updated document, the updated document is discarded. As a consequence find usages and follow symbol fails for the renamed function. Now the document call back provided to CppSourceProcessor is responsible for updating the document revision based on the latest revision in the global snapshot. Change-Id: I4dfa0a4d34991655acfa749109f00c47b0fbfdbe Reviewed-by: Orgad Shaneh Reviewed-by: Erik Verbruggen Reviewed-by: Eike Ziller --- src/plugins/cpptools/cppsourceprocessor.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp') diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp index 8533257564..4f292c0a34 100644 --- a/src/plugins/cpptools/cppsourceprocessor.cpp +++ b/src/plugins/cpptools/cppsourceprocessor.cpp @@ -117,7 +117,6 @@ CppSourceProcessor::CppSourceProcessor(const Snapshot &snapshot, DocumentCallbac m_documentFinished(documentFinished), m_preprocess(this, &m_env), m_languageFeatures(LanguageFeatures::defaultFeatures()), - m_revision(0), m_defaultCodec(Core::EditorManager::defaultTextCodec()) { m_preprocess.setKeepComments(true); @@ -126,9 +125,6 @@ CppSourceProcessor::CppSourceProcessor(const Snapshot &snapshot, DocumentCallbac CppSourceProcessor::~CppSourceProcessor() { } -void CppSourceProcessor::setRevision(unsigned revision) -{ m_revision = revision; } - void CppSourceProcessor::setWorkingCopy(const WorkingCopy &workingCopy) { m_workingCopy = workingCopy; } @@ -470,7 +466,6 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In qCDebug(log) << "Parsing:" << absoluteFileName << "contents:" << contents.size() << "bytes"; Document::Ptr document = Document::create(absoluteFileName); - document->setRevision(m_revision); document->setEditorRevision(editorRevision); document->setLanguageFeatures(m_languageFeatures); foreach (const QString &include, initialIncludes) { -- cgit v1.2.1