Commit 6174cca5 authored by Nikolai Kosjar's avatar Nikolai Kosjar

Move CanonicalSymbol from CppEditor to CppTools

Needed for a follow-up change.

Change-Id: Ibb4815f3411f0d63deac8c32583178470668f67b
Reviewed-by: Ivan Donchevskii's avatarIvan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent d84a6ed4
......@@ -26,7 +26,6 @@
#include "cppeditor.h"
#include "cppautocompleter.h"
#include "cppcanonicalsymbol.h"
#include "cppdocumentationcommenthelper.h"
#include "cppeditorconstants.h"
#include "cppeditordocument.h"
......@@ -47,6 +46,7 @@
#include <coreplugin/editormanager/documentmodel.h>
#include <coreplugin/infobar.h>
#include <cpptools/cppcanonicalsymbol.h>
#include <cpptools/cppchecksymbols.h>
#include <cpptools/cppcodeformatter.h>
#include <cpptools/cppcompletionassistprovider.h>
......
......@@ -3,7 +3,6 @@ include(../../qtcreatorplugin.pri)
HEADERS += \
cppautocompleter.h \
cppcanonicalsymbol.h \
cppcodemodelinspectordialog.h \
cppdocumentationcommenthelper.h \
cppeditor.h \
......@@ -35,7 +34,6 @@ HEADERS += \
SOURCES += \
cppautocompleter.cpp \
cppcanonicalsymbol.cpp \
cppcodemodelinspectordialog.cpp \
cppdocumentationcommenthelper.cpp \
cppeditor.cpp \
......
......@@ -22,8 +22,6 @@ QtcPlugin {
files: [
"cppautocompleter.cpp",
"cppautocompleter.h",
"cppcanonicalsymbol.cpp",
"cppcanonicalsymbol.h",
"cppcodemodelinspectordialog.cpp",
"cppcodemodelinspectordialog.h",
"cppcodemodelinspectordialog.ui",
......
......@@ -25,9 +25,9 @@
#include "cppuseselectionsupdater.h"
#include "cppcanonicalsymbol.h"
#include "cppeditor.h"
#include <cpptools/cppcanonicalsymbol.h>
#include <cpptools/cpplocalsymbols.h>
#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolsreuse.h>
......@@ -125,7 +125,7 @@ public:
{
TextEditor::Convenience::convertPosition(textCursor.document(), textCursor.position(),
&line, &column);
CppEditor::Internal::CanonicalSymbol canonicalSymbol(document, snapshot);
CppTools::CanonicalSymbol canonicalSymbol(document, snapshot);
scope = canonicalSymbol.getScopeAndExpression(textCursor, &expression);
}
......@@ -199,7 +199,7 @@ QList<int> findReferences(const Params &p)
typeOfExpression.init(p.document, snapshot);
typeOfExpression.setExpandTemplates(true);
using CppEditor::Internal::CanonicalSymbol;
using CppTools::CanonicalSymbol;
if (Symbol *s = CanonicalSymbol::canonicalSymbol(p.scope, p.expression, typeOfExpression)) {
CppTools::CppModelManager *mmi = CppTools::CppModelManager::instance();
result = mmi->references(s, typeOfExpression.context());
......
......@@ -35,8 +35,7 @@
using namespace CPlusPlus;
namespace CppEditor {
namespace Internal {
namespace CppTools {
CanonicalSymbol::CanonicalSymbol(const Document::Ptr &document,
const Snapshot &snapshot)
......@@ -129,5 +128,4 @@ Symbol *CanonicalSymbol::canonicalSymbol(Scope *scope, const QString &code,
return 0;
}
} // namespace Internal
} // namespace CppEditor
......@@ -25,16 +25,17 @@
#pragma once
#include "cpptools_global.h"
#include <cplusplus/LookupContext.h>
#include <cplusplus/Symbol.h>
#include <cplusplus/TypeOfExpression.h>
QT_FORWARD_DECLARE_CLASS(QTextCursor)
namespace CppEditor {
namespace Internal {
namespace CppTools {
class CanonicalSymbol
class CPPTOOLS_EXPORT CanonicalSymbol
{
public:
CanonicalSymbol(const CPlusPlus::Document::Ptr &document,
......@@ -58,5 +59,4 @@ private:
CPlusPlus::TypeOfExpression m_typeOfExpression;
};
} // namespace Internal
} // namespace CppEditor
} // namespace CppTools
......@@ -12,6 +12,7 @@ HEADERS += \
clangdiagnosticconfig.h \
clangdiagnosticconfigsmodel.h \
clangdiagnosticconfigswidget.h \
cppcanonicalsymbol.h \
cppchecksymbols.h \
cppclassesfilter.h \
cppcodeformatter.h \
......@@ -95,6 +96,7 @@ SOURCES += \
clangdiagnosticconfig.cpp \
clangdiagnosticconfigsmodel.cpp \
clangdiagnosticconfigswidget.cpp \
cppcanonicalsymbol.cpp \
cppchecksymbols.cpp \
cppclassesfilter.cpp \
cppcodeformatter.cpp \
......
......@@ -51,6 +51,8 @@ Project {
"clangdiagnosticconfigswidget.ui",
"compileroptionsbuilder.cpp",
"compileroptionsbuilder.h",
"cppcanonicalsymbol.cpp",
"cppcanonicalsymbol.h",
"cppchecksymbols.cpp",
"cppchecksymbols.h",
"cppclassesfilter.cpp",
......
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