forked from qt-creator/qt-creator
CppEditor: Use SymbolFinder from CppModelManager in CppElementEvaluator
...in order to profit from its file iteration cache. Change-Id: I3b7c3e7bd3fd24b0a4dfa29f83158baa9414cc06 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cpptoolsreuse.h>
|
||||
#include <cpptools/symbolfinder.h>
|
||||
#include <cpptools/typehierarchybuilder.h>
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
@@ -180,9 +181,11 @@ void CppElementEvaluator::handleLookupItemMatch(const Snapshot &snapshot,
|
||||
&& (declaration->asTemplate()->declaration()->isClass()
|
||||
|| declaration->asTemplate()->declaration()->isForwardClassDeclaration()))) {
|
||||
LookupContext contextToUse = context;
|
||||
if (declaration->isForwardClassDeclaration())
|
||||
if (Symbol *classDeclaration =
|
||||
m_symbolFinder.findMatchingClassDeclaration(declaration, snapshot)) {
|
||||
if (declaration->isForwardClassDeclaration()) {
|
||||
const auto symbolFinder = m_modelManager->symbolFinder();
|
||||
Symbol *classDeclaration = symbolFinder->findMatchingClassDeclaration(declaration,
|
||||
snapshot);
|
||||
if (classDeclaration) {
|
||||
declaration = classDeclaration;
|
||||
const QString fileName = QString::fromUtf8(declaration->fileName(),
|
||||
declaration->fileNameLength());
|
||||
@@ -190,6 +193,7 @@ void CppElementEvaluator::handleLookupItemMatch(const Snapshot &snapshot,
|
||||
if (declarationDocument != context.thisDocument())
|
||||
contextToUse = LookupContext(declarationDocument, snapshot);
|
||||
}
|
||||
}
|
||||
|
||||
CppClass *cppClass = new CppClass(declaration);
|
||||
if (m_lookupBaseClasses)
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#ifndef CPPELEMENTEVALUATOR_H
|
||||
#define CPPELEMENTEVALUATOR_H
|
||||
|
||||
#include <cpptools/symbolfinder.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <texteditor/helpitem.h>
|
||||
|
||||
@@ -88,7 +87,6 @@ private:
|
||||
bool m_lookupDerivedClasses;
|
||||
QSharedPointer<CppElement> m_element;
|
||||
QString m_diagnosis;
|
||||
CppTools::SymbolFinder m_symbolFinder;
|
||||
};
|
||||
|
||||
class CppElement
|
||||
|
||||
Reference in New Issue
Block a user