Commit 4b99d218 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppEditor: Dump also merged entities if invoking CppCodeModelInspector

Change-Id: I6a167b47363fb14452bd8ba3dc9d4242d17c25b6
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 25be7e08
......@@ -34,7 +34,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <cpptools/cppcodemodelinspectordumper.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolseditorsupport.h>
#include <projectexplorer/project.h>
......@@ -1335,7 +1335,7 @@ void CppCodeModelInspectorDialog::onWorkingCopyDocumentSelected(const QModelInde
void CppCodeModelInspectorDialog::refresh()
{
CppModelManagerInterface *cmm = CppModelManagerInterface::instance();
CppTools::Internal::CppModelManager *cmm = CppTools::Internal::CppModelManager::instance();
const int oldSnapshotIndex = m_ui->snapshotSelector->currentIndex();
const bool selectEditorRelevant
......@@ -1443,6 +1443,9 @@ void CppCodeModelInspectorDialog::refresh()
}
m_workingCopyView->selectIndex(index);
}
// Merged entities
dumper.dumpMergedEntities(cmm->includePaths(), cmm->frameworkPaths(), cmm->definedMacros());
}
enum DocumentTabs {
......
......@@ -572,6 +572,28 @@ void Dumper::dumpWorkingCopy(const CppModelManagerInterface::WorkingCopy &workin
}
}
void Dumper::dumpMergedEntities(const QStringList &mergedIncludePaths,
const QStringList &mergedFrameworkPaths,
const QByteArray &mergedMacros)
{
m_out << "Merged Entities{{{1\n";
const QByteArray i2 = indent(2);
const QByteArray i3 = indent(3);
m_out << i2 << "Merged Include Paths{{{2\n";
dumpStringList(mergedIncludePaths, i3);
m_out << i2 << "Merged Framework Paths{{{2\n";
dumpStringList(mergedFrameworkPaths, i3);
m_out << i2 << "Merged Defines{{{2\n";
m_out << mergedMacros;
}
void Dumper::dumpStringList(const QStringList &list, const QByteArray &indent)
{
foreach (const QString &item, list)
m_out << indent << item << "\n";
}
void Dumper::dumpDocuments(const QList<CPlusPlus::Document::Ptr> &documents, bool skipDetails)
{
const QByteArray i2 = indent(2);
......
......@@ -72,8 +72,12 @@ public:
const QString &title,
bool isGlobalSnapshot = false);
void dumpWorkingCopy(const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy);
void dumpMergedEntities(const QStringList &mergedIncludePaths,
const QStringList &mergedFrameworkPaths,
const QByteArray &mergedMacros);
private:
void dumpStringList(const QStringList &list, const QByteArray &indent);
void dumpDocuments(const QList<CPlusPlus::Document::Ptr> &documents,
bool skipDetails = false);
static QByteArray indent(int level);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment