forked from qt-creator/qt-creator
Clang: new empty locator filter classes
Introduce classes to replace builtin locator filters. Change-Id: I5cc6f15fb0f59ea8a51b14a86301cf219cc0d6d6 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -21,6 +21,7 @@ SOURCES += \
|
||||
clangcompletionassistprovider.cpp \
|
||||
clangcompletionchunkstotextconverter.cpp \
|
||||
clangcompletioncontextanalyzer.cpp \
|
||||
clangcurrentdocumentfilter.cpp \
|
||||
clangdiagnosticfilter.cpp \
|
||||
clangdiagnosticmanager.cpp \
|
||||
clangdiagnostictooltipwidget.cpp \
|
||||
@@ -58,6 +59,7 @@ HEADERS += \
|
||||
clangcompletionchunkstotextconverter.h \
|
||||
clangcompletioncontextanalyzer.h \
|
||||
clangconstants.h \
|
||||
clangcurrentdocumentfilter.h \
|
||||
clangdiagnosticfilter.h \
|
||||
clangdiagnosticmanager.h \
|
||||
clangdiagnostictooltipwidget.h \
|
||||
@@ -75,9 +77,9 @@ HEADERS += \
|
||||
clangprojectsettingswidget.h \
|
||||
clangrefactoringengine.h \
|
||||
clangtextmark.h \
|
||||
clangtokeninfosreporter.h \
|
||||
clanguiheaderondiskmanager.h \
|
||||
clangutils.h \
|
||||
clangtokeninfosreporter.h
|
||||
clangutils.h
|
||||
|
||||
FORMS += clangprojectsettingswidget.ui
|
||||
|
||||
|
@@ -62,6 +62,8 @@ QtcPlugin {
|
||||
"clangcompletioncontextanalyzer.cpp",
|
||||
"clangcompletioncontextanalyzer.h",
|
||||
"clangconstants.h",
|
||||
"clangcurrentdocumentfilter.cpp",
|
||||
"clangcurrentdocumentfilter.h",
|
||||
"clangdiagnosticfilter.cpp",
|
||||
"clangdiagnosticfilter.h",
|
||||
"clangdiagnosticmanager.cpp",
|
||||
|
57
src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp
Normal file
57
src/plugins/clangcodemodel/clangcurrentdocumentfilter.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "clangcurrentdocumentfilter.h"
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
|
||||
ClangCurrentDocumentFilter::ClangCurrentDocumentFilter()
|
||||
{
|
||||
setId(CppTools::Constants::CURRENT_DOCUMENT_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME);
|
||||
setShortcutString(QString(QLatin1Char('.')));
|
||||
setPriority(High);
|
||||
setIncludedByDefault(false);
|
||||
}
|
||||
|
||||
QList<Core::LocatorFilterEntry> ClangCurrentDocumentFilter::matchesFor(
|
||||
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
|
||||
{
|
||||
return QList<Core::LocatorFilterEntry>();
|
||||
}
|
||||
|
||||
void ClangCurrentDocumentFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ClangCurrentDocumentFilter::refresh(QFutureInterface<void> &)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // namespace ClangCodeModel
|
46
src/plugins/clangcodemodel/clangcurrentdocumentfilter.h
Normal file
46
src/plugins/clangcodemodel/clangcurrentdocumentfilter.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/locator/ilocatorfilter.h>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
|
||||
class ClangCurrentDocumentFilter : public Core::ILocatorFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ClangCurrentDocumentFilter();
|
||||
|
||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||
const QString &entry) override;
|
||||
void accept(Core::LocatorFilterEntry selection,
|
||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
||||
void refresh(QFutureInterface<void> &future) override;
|
||||
};
|
||||
|
||||
} // namespace ClangCodeModel
|
@@ -31,6 +31,7 @@
|
||||
#include "clangfollowsymbol.h"
|
||||
#include "clanghoverhandler.h"
|
||||
#include "clangrefactoringengine.h"
|
||||
#include "clangcurrentdocumentfilter.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <cpptools/cppfollowsymbolundercursor.h>
|
||||
|
@@ -1,28 +1,38 @@
|
||||
INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/refactoringengine.h \
|
||||
$$PWD/refactoringconnectionclient.h \
|
||||
$$PWD/clangqueryexamplehighlighter.h \
|
||||
$$PWD/clangqueryexamplehighlightmarker.h \
|
||||
$$PWD/clangqueryhighlighter.h \
|
||||
$$PWD/clangqueryhighlightmarker.h \
|
||||
$$PWD/clangqueryprojectsfindfilter.h \
|
||||
$$PWD/classesfilter.h \
|
||||
$$PWD/functionsfilter.h \
|
||||
$$PWD/includesfilter.h \
|
||||
$$PWD/locatorfilter.h \
|
||||
$$PWD/projectpartutilities.h \
|
||||
$$PWD/refactoringclient.h \
|
||||
$$PWD/refactoringconnectionclient.h \
|
||||
$$PWD/refactoringengine.h \
|
||||
$$PWD/refactoringprojectupdater.h \
|
||||
$$PWD/searchinterface.h \
|
||||
$$PWD/searchhandle.h \
|
||||
$$PWD/projectpartutilities.h \
|
||||
$$PWD/clangqueryprojectsfindfilter.h \
|
||||
$$PWD/clangqueryexamplehighlightmarker.h \
|
||||
$$PWD/clangqueryhighlightmarker.h \
|
||||
$$PWD/clangqueryexamplehighlighter.h \
|
||||
$$PWD/clangqueryhighlighter.h \
|
||||
$$PWD/refactoringprojectupdater.h \
|
||||
$$PWD/symbolsfindfilter.h \
|
||||
$$PWD/symbolqueryinterface.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/refactoringengine.cpp \
|
||||
$$PWD/refactoringconnectionclient.cpp \
|
||||
$$PWD/refactoringclient.cpp \
|
||||
$$PWD/searchinterface.cpp \
|
||||
$$PWD/searchhandle.cpp \
|
||||
$$PWD/projectpartutilities.cpp \
|
||||
$$PWD/clangqueryprojectsfindfilter.cpp \
|
||||
$$PWD/clangqueryexamplehighlighter.cpp \
|
||||
$$PWD/clangqueryhighlighter.cpp \
|
||||
$$PWD/refactoringprojectupdater.cpp
|
||||
$$PWD/clangqueryprojectsfindfilter.cpp \
|
||||
$$PWD/classesfilter.cpp \
|
||||
$$PWD/functionsfilter.cpp \
|
||||
$$PWD/includesfilter.cpp \
|
||||
$$PWD/locatorfilter.cpp \
|
||||
$$PWD/projectpartutilities.cpp \
|
||||
$$PWD/refactoringclient.cpp \
|
||||
$$PWD/refactoringconnectionclient.cpp \
|
||||
$$PWD/refactoringengine.cpp \
|
||||
$$PWD/refactoringprojectupdater.cpp \
|
||||
$$PWD/searchinterface.cpp \
|
||||
$$PWD/searchhandle.cpp \
|
||||
$$PWD/symbolsfindfilter.cpp
|
||||
|
@@ -8,28 +8,32 @@ requires(!isEmpty(LIBTOOLING_LIBS))
|
||||
|
||||
HEADERS += \
|
||||
clangrefactoringplugin.h \
|
||||
baseclangquerytexteditorwidget.h \
|
||||
clangqueryexampletexteditorwidget.h \
|
||||
clangqueryhoverhandler.h \
|
||||
clangqueryprojectsfindfilterwidget.h \
|
||||
clangquerytexteditorwidget.h \
|
||||
qtcreatorclangqueryfindfilter.h \
|
||||
qtcreatorsearch.h \
|
||||
qtcreatorsearchhandle.h \
|
||||
qtcreatorclangqueryfindfilter.h \
|
||||
clangqueryprojectsfindfilterwidget.h \
|
||||
clangqueryexampletexteditorwidget.h \
|
||||
clangquerytexteditorwidget.h \
|
||||
baseclangquerytexteditorwidget.h \
|
||||
clangqueryhoverhandler.h \
|
||||
symbolquery.h \
|
||||
qtcreatorsymbolsfindfilter.h \
|
||||
querysqlitestatementfactory.h \
|
||||
sourcelocations.h
|
||||
sourcelocations.h \
|
||||
symbolsfindfilterconfigwidget.h \
|
||||
symbolquery.h
|
||||
|
||||
SOURCES += \
|
||||
clangrefactoringplugin.cpp \
|
||||
baseclangquerytexteditorwidget.cpp \
|
||||
clangqueryexampletexteditorwidget.cpp \
|
||||
clangqueryhoverhandler.cpp \
|
||||
clangqueryprojectsfindfilterwidget.cpp \
|
||||
clangquerytexteditorwidget.cpp \
|
||||
qtcreatorclangqueryfindfilter.cpp \
|
||||
qtcreatorsearch.cpp \
|
||||
qtcreatorsearchhandle.cpp \
|
||||
qtcreatorclangqueryfindfilter.cpp \
|
||||
clangqueryprojectsfindfilterwidget.cpp \
|
||||
clangqueryexampletexteditorwidget.cpp \
|
||||
clangquerytexteditorwidget.cpp \
|
||||
baseclangquerytexteditorwidget.cpp \
|
||||
clangqueryhoverhandler.cpp \
|
||||
qtcreatorsymbolsfindfilter.cpp \
|
||||
symbolsfindfilterconfigwidget.cpp \
|
||||
symbolquery.cpp
|
||||
|
||||
FORMS += \
|
||||
|
@@ -52,6 +52,14 @@ QtcPlugin {
|
||||
"clangquerytexteditorwidget.h",
|
||||
"clangrefactoringplugin.cpp",
|
||||
"clangrefactoringplugin.h",
|
||||
"classesfilter.cpp",
|
||||
"classesfilter.h",
|
||||
"functionsfilter.cpp",
|
||||
"functionsfilter.h",
|
||||
"includesfilter.cpp",
|
||||
"includesfilter.h",
|
||||
"locatorfilter.cpp",
|
||||
"locatorfilter.h",
|
||||
"projectpartutilities.cpp",
|
||||
"projectpartutilities.h",
|
||||
"qtcreatorclangqueryfindfilter.cpp",
|
||||
@@ -60,6 +68,8 @@ QtcPlugin {
|
||||
"qtcreatorsearch.h",
|
||||
"qtcreatorsearchhandle.cpp",
|
||||
"qtcreatorsearchhandle.h",
|
||||
"qtcreatorsymbolsfindfilter.cpp",
|
||||
"qtcreatorsymbolsfindfilter.h",
|
||||
"querysqlitestatementfactory.h",
|
||||
"refactoringclient.cpp",
|
||||
"refactoringclient.h",
|
||||
@@ -74,6 +84,10 @@ QtcPlugin {
|
||||
"searchinterface.cpp",
|
||||
"searchinterface.h",
|
||||
"sourcelocations.h",
|
||||
"symbolsfindfilter.cpp",
|
||||
"symbolsfindfilter.h",
|
||||
"symbolsfindfilterconfigwidget.cpp",
|
||||
"symbolsfindfilterconfigwidget.h",
|
||||
"symbolquery.cpp",
|
||||
"symbolquery.h",
|
||||
]
|
||||
|
@@ -24,6 +24,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "clangrefactoringplugin.h"
|
||||
#include "classesfilter.h"
|
||||
#include "functionsfilter.h"
|
||||
#include "includesfilter.h"
|
||||
#include "locatorfilter.h"
|
||||
#include "symbolsfindfilter.h"
|
||||
#include "symbolquery.h"
|
||||
#include "sqlitereadstatement.h"
|
||||
#include "sqlitedatabase.h"
|
||||
@@ -94,6 +99,12 @@ ClangRefactoringPlugin::~ClangRefactoringPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
static bool useClangFilters()
|
||||
{
|
||||
static bool use = qEnvironmentVariableIntValue("QTC_CLANG_LOCATORS");
|
||||
return use;
|
||||
}
|
||||
|
||||
bool ClangRefactoringPlugin::initialize(const QStringList & /*arguments*/, QString * /*errorMessage*/)
|
||||
{
|
||||
d.reset(new ClangRefactoringPluginData);
|
||||
@@ -105,13 +116,16 @@ bool ClangRefactoringPlugin::initialize(const QStringList & /*arguments*/, QStri
|
||||
connectBackend();
|
||||
startBackend();
|
||||
|
||||
CppTools::CppModelManager::addRefactoringEngine(
|
||||
CppTools::RefactoringEngineType::ClangRefactoring, &refactoringEngine());
|
||||
|
||||
initializeFilters();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ClangRefactoringPlugin::extensionsInitialized()
|
||||
{
|
||||
CppTools::CppModelManager::addRefactoringEngine(
|
||||
CppTools::RefactoringEngineType::ClangRefactoring, &refactoringEngine());
|
||||
}
|
||||
|
||||
ExtensionSystem::IPlugin::ShutdownFlag ClangRefactoringPlugin::aboutToShutdown()
|
||||
@@ -152,4 +166,17 @@ void ClangRefactoringPlugin::backendIsConnected()
|
||||
d->engine.setRefactoringEngineAvailable(true);
|
||||
}
|
||||
|
||||
void ClangRefactoringPlugin::initializeFilters()
|
||||
{
|
||||
if (!useClangFilters())
|
||||
return;
|
||||
|
||||
CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
|
||||
modelManager->setLocatorFilter(std::make_unique<LocatorFilter>());
|
||||
modelManager->setClassesFilter(std::make_unique<ClassesFilter>());
|
||||
modelManager->setIncludesFilter(std::make_unique<IncludesFilter>());
|
||||
modelManager->setFunctionsFilter(std::make_unique<FunctionsFilter>());
|
||||
modelManager->setSymbolsFindFilter(std::make_unique<SymbolsFindFilter>());
|
||||
}
|
||||
|
||||
} // namespace ClangRefactoring
|
||||
|
@@ -29,8 +29,8 @@
|
||||
#include "refactoringclient.h"
|
||||
#include "qtcreatorclangqueryfindfilter.h"
|
||||
#include "qtcreatorsearch.h"
|
||||
#include "refactoringconnectionclient.h"
|
||||
|
||||
#include <refactoringconnectionclient.h>
|
||||
#include <refactoringserverproxy.h>
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
@@ -59,6 +59,7 @@ private:
|
||||
void startBackend();
|
||||
void connectBackend();
|
||||
void backendIsConnected();
|
||||
void initializeFilters();
|
||||
|
||||
private:
|
||||
static std::unique_ptr<ClangRefactoringPluginData> d;
|
||||
|
56
src/plugins/clangrefactoring/classesfilter.cpp
Normal file
56
src/plugins/clangrefactoring/classesfilter.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "classesfilter.h"
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
ClassesFilter::ClassesFilter()
|
||||
{
|
||||
setId(CppTools::Constants::CLASSES_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::CLASSES_FILTER_DISPLAY_NAME);
|
||||
setShortcutString(QLatin1String("c"));
|
||||
setIncludedByDefault(false);
|
||||
}
|
||||
|
||||
QList<Core::LocatorFilterEntry> ClassesFilter::matchesFor(
|
||||
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
|
||||
{
|
||||
return QList<Core::LocatorFilterEntry>();
|
||||
}
|
||||
|
||||
void ClassesFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ClassesFilter::refresh(QFutureInterface<void> &)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // namespace ClangRefactoring
|
45
src/plugins/clangrefactoring/classesfilter.h
Normal file
45
src/plugins/clangrefactoring/classesfilter.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/locator/ilocatorfilter.h>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
class ClassesFilter : public Core::ILocatorFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ClassesFilter();
|
||||
|
||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||
const QString &entry) override;
|
||||
void accept(Core::LocatorFilterEntry selection,
|
||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
||||
void refresh(QFutureInterface<void> &future) override;
|
||||
};
|
||||
|
||||
} // namespace ClangRefactoring
|
56
src/plugins/clangrefactoring/functionsfilter.cpp
Normal file
56
src/plugins/clangrefactoring/functionsfilter.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "functionsfilter.h"
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
FunctionsFilter::FunctionsFilter()
|
||||
{
|
||||
setId(CppTools::Constants::FUNCTIONS_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::FUNCTIONS_FILTER_DISPLAY_NAME);
|
||||
setShortcutString(QString(QLatin1Char('m')));
|
||||
setIncludedByDefault(false);
|
||||
}
|
||||
|
||||
QList<Core::LocatorFilterEntry> FunctionsFilter::matchesFor(
|
||||
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
|
||||
{
|
||||
return QList<Core::LocatorFilterEntry>();
|
||||
}
|
||||
|
||||
void FunctionsFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FunctionsFilter::refresh(QFutureInterface<void> &)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // namespace ClangRefactoring
|
45
src/plugins/clangrefactoring/functionsfilter.h
Normal file
45
src/plugins/clangrefactoring/functionsfilter.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/locator/ilocatorfilter.h>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
class FunctionsFilter : public Core::ILocatorFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FunctionsFilter();
|
||||
|
||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||
const QString &entry) override;
|
||||
void accept(Core::LocatorFilterEntry selection,
|
||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
||||
void refresh(QFutureInterface<void> &future) override;
|
||||
};
|
||||
|
||||
} // namespace ClangRefactoring
|
57
src/plugins/clangrefactoring/includesfilter.cpp
Normal file
57
src/plugins/clangrefactoring/includesfilter.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "includesfilter.h"
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
IncludesFilter::IncludesFilter()
|
||||
{
|
||||
setId(CppTools::Constants::INCLUDES_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::INCLUDES_FILTER_DISPLAY_NAME);
|
||||
setShortcutString(QString(QLatin1Char('a')));
|
||||
setIncludedByDefault(true);
|
||||
setPriority(ILocatorFilter::Low);
|
||||
}
|
||||
|
||||
QList<Core::LocatorFilterEntry> IncludesFilter::matchesFor(
|
||||
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
|
||||
{
|
||||
return QList<Core::LocatorFilterEntry>();
|
||||
}
|
||||
|
||||
void IncludesFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void IncludesFilter::refresh(QFutureInterface<void> &)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // namespace ClangRefactoring
|
45
src/plugins/clangrefactoring/includesfilter.h
Normal file
45
src/plugins/clangrefactoring/includesfilter.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/locator/ilocatorfilter.h>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
class IncludesFilter : public Core::ILocatorFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
IncludesFilter();
|
||||
|
||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||
const QString &entry) override;
|
||||
void accept(Core::LocatorFilterEntry selection,
|
||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
||||
void refresh(QFutureInterface<void> &future) override;
|
||||
};
|
||||
|
||||
} // namespace ClangRefactoring
|
56
src/plugins/clangrefactoring/locatorfilter.cpp
Normal file
56
src/plugins/clangrefactoring/locatorfilter.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "locatorfilter.h"
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
LocatorFilter::LocatorFilter()
|
||||
{
|
||||
setId(CppTools::Constants::LOCATOR_FILTER_ID);
|
||||
setDisplayName(CppTools::Constants::LOCATOR_FILTER_DISPLAY_NAME);
|
||||
setShortcutString(QString(QLatin1Char(':')));
|
||||
setIncludedByDefault(false);
|
||||
}
|
||||
|
||||
QList<Core::LocatorFilterEntry> LocatorFilter::matchesFor(
|
||||
QFutureInterface<Core::LocatorFilterEntry> &, const QString &)
|
||||
{
|
||||
return QList<Core::LocatorFilterEntry>();
|
||||
}
|
||||
|
||||
void LocatorFilter::accept(Core::LocatorFilterEntry, QString *, int *, int *) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LocatorFilter::refresh(QFutureInterface<void> &)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // namespace ClangRefactoring
|
45
src/plugins/clangrefactoring/locatorfilter.h
Normal file
45
src/plugins/clangrefactoring/locatorfilter.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/locator/ilocatorfilter.h>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
class LocatorFilter : public Core::ILocatorFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LocatorFilter();
|
||||
|
||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||
const QString &entry) override;
|
||||
void accept(Core::LocatorFilterEntry selection,
|
||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
||||
void refresh(QFutureInterface<void> &future) override;
|
||||
};
|
||||
|
||||
} // namespace ClangRefactoring
|
41
src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.cpp
Normal file
41
src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qtcreatorsymbolsfindfilter.h"
|
||||
|
||||
#include "symbolsfindfilterconfigwidget.h"
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
QtcreatorSymbolsFindFilter::QtcreatorSymbolsFindFilter()
|
||||
{
|
||||
}
|
||||
|
||||
QWidget *QtcreatorSymbolsFindFilter::createConfigWidget()
|
||||
{
|
||||
return new SymbolsFindFilterConfigWidget(this);
|
||||
}
|
||||
|
||||
} // ClangRefactoring
|
41
src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.h
Normal file
41
src/plugins/clangrefactoring/qtcreatorsymbolsfindfilter.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "symbolsfindfilter.h"
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
class QtcreatorSymbolsFindFilter : public SymbolsFindFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QtcreatorSymbolsFindFilter();
|
||||
|
||||
QWidget *createConfigWidget() override;
|
||||
};
|
||||
|
||||
} // ClangRefactoring
|
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "refactoringengine.h"
|
||||
|
||||
#include <searchhandle.h>
|
||||
#include "searchhandle.h"
|
||||
|
||||
#include <refactoringclientinterface.h>
|
||||
|
||||
|
@@ -27,8 +27,9 @@
|
||||
|
||||
#include "symbolqueryinterface.h"
|
||||
|
||||
#include "sourcelocations.h"
|
||||
|
||||
#include <filepathid.h>
|
||||
#include <sourcelocations.h>
|
||||
|
||||
#include <cpptools/usages.h>
|
||||
|
||||
|
67
src/plugins/clangrefactoring/symbolsfindfilter.cpp
Normal file
67
src/plugins/clangrefactoring/symbolsfindfilter.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "symbolsfindfilter.h"
|
||||
|
||||
#include <cpptools/cpptoolsconstants.h>
|
||||
|
||||
#include <QSettings>
|
||||
|
||||
using namespace Core;
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
SymbolsFindFilter::SymbolsFindFilter()
|
||||
{
|
||||
}
|
||||
|
||||
QString SymbolsFindFilter::id() const
|
||||
{
|
||||
return QLatin1String(CppTools::Constants::SYMBOLS_FIND_FILTER_ID);
|
||||
}
|
||||
|
||||
QString SymbolsFindFilter::displayName() const
|
||||
{
|
||||
return CppTools::Constants::SYMBOLS_FIND_FILTER_DISPLAY_NAME;
|
||||
}
|
||||
|
||||
bool SymbolsFindFilter::isEnabled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void SymbolsFindFilter::findAll(const QString &, FindFlags)
|
||||
{
|
||||
}
|
||||
|
||||
void SymbolsFindFilter::writeSettings(QSettings *)
|
||||
{
|
||||
}
|
||||
|
||||
void SymbolsFindFilter::readSettings(QSettings *)
|
||||
{
|
||||
}
|
||||
|
||||
} // ClangRefactoring
|
59
src/plugins/clangrefactoring/symbolsfindfilter.h
Normal file
59
src/plugins/clangrefactoring/symbolsfindfilter.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/find/ifindfilter.h>
|
||||
|
||||
#include <QFutureWatcher>
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
#include <QCheckBox>
|
||||
#include <QRadioButton>
|
||||
|
||||
namespace Core { class SearchResult; }
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
class CppModelManager;
|
||||
|
||||
class SymbolsFindFilter : public Core::IFindFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SymbolsFindFilter();
|
||||
|
||||
QString id() const;
|
||||
QString displayName() const;
|
||||
bool isEnabled() const;
|
||||
|
||||
void findAll(const QString &txt, Core::FindFlags findFlags);
|
||||
|
||||
void writeSettings(QSettings *settings);
|
||||
void readSettings(QSettings *settings);
|
||||
};
|
||||
|
||||
} // ClangRefactoring
|
@@ -0,0 +1,39 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "symbolsfindfilterconfigwidget.h"
|
||||
|
||||
#include "symbolsfindfilter.h"
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
SymbolsFindFilterConfigWidget::SymbolsFindFilterConfigWidget(SymbolsFindFilter *)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // ClangRefactoring
|
||||
|
41
src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.h
Normal file
41
src/plugins/clangrefactoring/symbolsfindfilterconfigwidget.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace ClangRefactoring {
|
||||
|
||||
class SymbolsFindFilter;
|
||||
|
||||
class SymbolsFindFilterConfigWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SymbolsFindFilterConfigWidget(SymbolsFindFilter *filter);
|
||||
};
|
||||
|
||||
} // ClangRefactoring
|
@@ -3,9 +3,11 @@ DEFINES += CORE_STATIC_LIBRARY
|
||||
HEADERS += \
|
||||
$$PWD/coreicons.h \
|
||||
$$PWD/id.h \
|
||||
$$PWD/find/ifindfilter.h
|
||||
$$PWD/find/ifindfilter.h \
|
||||
$$PWD/locator/ilocatorfilter.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/coreicons.cpp \
|
||||
$$PWD/id.cpp \
|
||||
$$PWD/find/ifindfilter.cpp
|
||||
$$PWD/find/ifindfilter.cpp \
|
||||
$$PWD/locator/ilocatorfilter.cpp
|
||||
|
@@ -25,16 +25,18 @@
|
||||
|
||||
#include "cppclassesfilter.h"
|
||||
|
||||
#include "cpptoolsconstants.h"
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppTools::Internal;
|
||||
|
||||
CppClassesFilter::CppClassesFilter(CppLocatorData *locatorData)
|
||||
: CppLocatorFilter(locatorData)
|
||||
{
|
||||
setId("Classes");
|
||||
setId(Constants::CLASSES_FILTER_ID);
|
||||
setDisplayName(Constants::CLASSES_FILTER_DISPLAY_NAME);
|
||||
setShortcutString(QLatin1String("c"));
|
||||
setIncludedByDefault(false);
|
||||
setDisplayName(tr("C++ Classes"));
|
||||
}
|
||||
|
||||
CppClassesFilter::~CppClassesFilter()
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "cppcurrentdocumentfilter.h"
|
||||
|
||||
#include "cppmodelmanager.h"
|
||||
#include "cpptoolsconstants.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
@@ -41,8 +42,8 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppTools::CppModelManager *ma
|
||||
: m_modelManager(manager)
|
||||
, search(stringTable)
|
||||
{
|
||||
setId("Methods in current Document");
|
||||
setDisplayName(tr("C++ Symbols in Current Document"));
|
||||
setId(Constants::CURRENT_DOCUMENT_FILTER_ID);
|
||||
setDisplayName(Constants::CURRENT_DOCUMENT_FILTER_DISPLAY_NAME);
|
||||
setShortcutString(".");
|
||||
setPriority(High);
|
||||
setIncludedByDefault(false);
|
||||
|
@@ -25,6 +25,8 @@
|
||||
|
||||
#include "cppfunctionsfilter.h"
|
||||
|
||||
#include "cpptoolsconstants.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
using namespace CppTools;
|
||||
@@ -33,8 +35,8 @@ using namespace CppTools::Internal;
|
||||
CppFunctionsFilter::CppFunctionsFilter(CppLocatorData *locatorData)
|
||||
: CppLocatorFilter(locatorData)
|
||||
{
|
||||
setId("Methods");
|
||||
setDisplayName(tr("C++ Functions"));
|
||||
setId(Constants::FUNCTIONS_FILTER_ID);
|
||||
setDisplayName(Constants::FUNCTIONS_FILTER_DISPLAY_NAME);
|
||||
setShortcutString("m");
|
||||
setIncludedByDefault(false);
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "cppincludesfilter.h"
|
||||
|
||||
#include "cppmodelmanager.h"
|
||||
#include "cpptoolsconstants.h"
|
||||
|
||||
#include <cplusplus/CppDocument.h>
|
||||
#include <coreplugin/editormanager/documentmodel.h>
|
||||
@@ -130,8 +131,8 @@ void CppIncludesIterator::fetchMore()
|
||||
|
||||
CppIncludesFilter::CppIncludesFilter()
|
||||
{
|
||||
setId("All Included C/C++ Files");
|
||||
setDisplayName(tr("All Included C/C++ Files"));
|
||||
setId(Constants::INCLUDES_FILTER_ID);
|
||||
setDisplayName(Constants::INCLUDES_FILTER_DISPLAY_NAME);
|
||||
setShortcutString("ai");
|
||||
setIncludedByDefault(true);
|
||||
setPriority(ILocatorFilter::Low);
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "cpplocatorfilter.h"
|
||||
#include "cppmodelmanager.h"
|
||||
#include "cpptoolsconstants.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
@@ -39,8 +40,8 @@ using namespace CppTools::Internal;
|
||||
CppLocatorFilter::CppLocatorFilter(CppLocatorData *locatorData)
|
||||
: m_data(locatorData)
|
||||
{
|
||||
setId("Classes and Methods");
|
||||
setDisplayName(tr("C++ Classes, Enums and Functions"));
|
||||
setId(Constants::LOCATOR_FILTER_ID);
|
||||
setDisplayName(Constants::LOCATOR_FILTER_DISPLAY_NAME);
|
||||
setShortcutString(":");
|
||||
setIncludedByDefault(false);
|
||||
}
|
||||
|
@@ -77,5 +77,24 @@ const char CPP_CLANG_FIXIT_AVAILABLE_MARKER_ID[] = "ClangFixItAvailableMarker";
|
||||
const char CPP_SETTINGS_ID[] = "Cpp";
|
||||
const char CPP_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++");
|
||||
|
||||
const char CURRENT_DOCUMENT_FILTER_ID[] = "Methods in current Document";
|
||||
const char CURRENT_DOCUMENT_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Symbols in Current Document");
|
||||
|
||||
const char CLASSES_FILTER_ID[] = "Classes";
|
||||
const char CLASSES_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Classes");
|
||||
|
||||
const char FUNCTIONS_FILTER_ID[] = "Methods";
|
||||
const char FUNCTIONS_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Functions");
|
||||
|
||||
const char INCLUDES_FILTER_ID[] = "All Included C/C++ Files";
|
||||
const char INCLUDES_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "All Included C/C++ Files");
|
||||
|
||||
const char LOCATOR_FILTER_ID[] = "Classes and Methods";
|
||||
const char LOCATOR_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Classes, Enums and Functions");
|
||||
|
||||
const char SYMBOLS_FIND_FILTER_ID[] = "Symbols";
|
||||
const char SYMBOLS_FIND_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C++ Symbols");
|
||||
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace CppTools
|
||||
|
@@ -69,12 +69,12 @@ SymbolsFindFilter::SymbolsFindFilter(CppModelManager *manager)
|
||||
|
||||
QString SymbolsFindFilter::id() const
|
||||
{
|
||||
return QLatin1String("CppSymbols");
|
||||
return QLatin1String(Constants::SYMBOLS_FIND_FILTER_ID);
|
||||
}
|
||||
|
||||
QString SymbolsFindFilter::displayName() const
|
||||
{
|
||||
return tr("C++ Symbols");
|
||||
return Constants::SYMBOLS_FIND_FILTER_DISPLAY_NAME;
|
||||
}
|
||||
|
||||
bool SymbolsFindFilter::isEnabled() const
|
||||
|
61
tests/unit/unittest/classesfilter-test.cpp
Normal file
61
tests/unit/unittest/classesfilter-test.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "googletest.h"
|
||||
|
||||
#include <clangrefactoring/classesfilter.h>
|
||||
|
||||
namespace {
|
||||
|
||||
class ClassesFilter : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
ClangRefactoring::ClassesFilter classesFilter;
|
||||
};
|
||||
|
||||
TEST_F(ClassesFilter, MatchesFor)
|
||||
{
|
||||
QFutureInterface<Core::LocatorFilterEntry> dummy;
|
||||
|
||||
auto matches = classesFilter.matchesFor(dummy, QString());
|
||||
}
|
||||
|
||||
TEST_F(ClassesFilter, Accept)
|
||||
{
|
||||
int start = 0;
|
||||
int length = 0;
|
||||
QString newText;
|
||||
|
||||
classesFilter.accept(Core::LocatorFilterEntry(), &newText, &start, &length);
|
||||
}
|
||||
|
||||
TEST_F(ClassesFilter, Refresh)
|
||||
{
|
||||
QFutureInterface<void> dummy;
|
||||
|
||||
classesFilter.refresh(dummy);
|
||||
}
|
||||
|
||||
}
|
61
tests/unit/unittest/functionsfilter-test.cpp
Normal file
61
tests/unit/unittest/functionsfilter-test.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "googletest.h"
|
||||
|
||||
#include <clangrefactoring/functionsfilter.h>
|
||||
|
||||
namespace {
|
||||
|
||||
class FunctionsFilter : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
ClangRefactoring::FunctionsFilter functionsFilter;
|
||||
};
|
||||
|
||||
TEST_F(FunctionsFilter, MatchesFor)
|
||||
{
|
||||
QFutureInterface<Core::LocatorFilterEntry> dummy;
|
||||
|
||||
auto matches = functionsFilter.matchesFor(dummy, QString());
|
||||
}
|
||||
|
||||
TEST_F(FunctionsFilter, Accept)
|
||||
{
|
||||
int start = 0;
|
||||
int length = 0;
|
||||
QString newText;
|
||||
|
||||
functionsFilter.accept(Core::LocatorFilterEntry(), &newText, &start, &length);
|
||||
}
|
||||
|
||||
TEST_F(FunctionsFilter, Refresh)
|
||||
{
|
||||
QFutureInterface<void> dummy;
|
||||
|
||||
functionsFilter.refresh(dummy);
|
||||
}
|
||||
|
||||
}
|
61
tests/unit/unittest/includesfilter-test.cpp
Normal file
61
tests/unit/unittest/includesfilter-test.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "googletest.h"
|
||||
|
||||
#include <clangrefactoring/includesfilter.h>
|
||||
|
||||
namespace {
|
||||
|
||||
class IncludesFilter : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
ClangRefactoring::IncludesFilter includesFilter;
|
||||
};
|
||||
|
||||
TEST_F(IncludesFilter, MatchesFor)
|
||||
{
|
||||
QFutureInterface<Core::LocatorFilterEntry> dummy;
|
||||
|
||||
auto matches = includesFilter.matchesFor(dummy, QString());
|
||||
}
|
||||
|
||||
TEST_F(IncludesFilter, Accept)
|
||||
{
|
||||
int start = 0;
|
||||
int length = 0;
|
||||
QString newText;
|
||||
|
||||
includesFilter.accept(Core::LocatorFilterEntry(), &newText, &start, &length);
|
||||
}
|
||||
|
||||
TEST_F(IncludesFilter, Refresh)
|
||||
{
|
||||
QFutureInterface<void> dummy;
|
||||
|
||||
includesFilter.refresh(dummy);
|
||||
}
|
||||
|
||||
}
|
61
tests/unit/unittest/locatorfilter-test.cpp
Normal file
61
tests/unit/unittest/locatorfilter-test.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "googletest.h"
|
||||
|
||||
#include <clangrefactoring/locatorfilter.h>
|
||||
|
||||
namespace {
|
||||
|
||||
class LocatorFilter : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
ClangRefactoring::LocatorFilter locatorFilter;
|
||||
};
|
||||
|
||||
TEST_F(LocatorFilter, MatchesFor)
|
||||
{
|
||||
QFutureInterface<Core::LocatorFilterEntry> dummy;
|
||||
|
||||
auto matches = locatorFilter.matchesFor(dummy, QString());
|
||||
}
|
||||
|
||||
TEST_F(LocatorFilter, Accept)
|
||||
{
|
||||
int start = 0;
|
||||
int length = 0;
|
||||
QString newText;
|
||||
|
||||
locatorFilter.accept(Core::LocatorFilterEntry(), &newText, &start, &length);
|
||||
}
|
||||
|
||||
TEST_F(LocatorFilter, Refresh)
|
||||
{
|
||||
QFutureInterface<void> dummy;
|
||||
|
||||
locatorFilter.refresh(dummy);
|
||||
}
|
||||
|
||||
}
|
43
tests/unit/unittest/symbolsfindfilter-test.cpp
Normal file
43
tests/unit/unittest/symbolsfindfilter-test.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "googletest.h"
|
||||
|
||||
#include <clangrefactoring/symbolsfindfilter.h>
|
||||
|
||||
namespace {
|
||||
|
||||
class SymbolsFindFilter : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
ClangRefactoring::SymbolsFindFilter symbolsFindFilter;
|
||||
};
|
||||
|
||||
TEST_F(SymbolsFindFilter, FindAll)
|
||||
{
|
||||
symbolsFindFilter.findAll("*", Core::FindRegularExpression);
|
||||
}
|
||||
|
||||
}
|
@@ -42,6 +42,7 @@ SOURCES += \
|
||||
clangpathwatcher-test.cpp \
|
||||
clangqueryexamplehighlightmarker-test.cpp \
|
||||
clangqueryhighlightmarker-test.cpp \
|
||||
classesfilter-test.cpp \
|
||||
clientserverinprocess-test.cpp \
|
||||
clientserveroutsideprocess-test.cpp \
|
||||
cppprojectfilecategorizer-test.cpp \
|
||||
@@ -50,9 +51,12 @@ SOURCES += \
|
||||
fakeprocess.cpp \
|
||||
filepath-test.cpp \
|
||||
filepathview-test.cpp \
|
||||
functionsfilter-test.cpp \
|
||||
gtest-creator-printing.cpp \
|
||||
gtest-qt-printing.cpp \
|
||||
includesfilter-test.cpp \
|
||||
lineprefixer-test.cpp \
|
||||
locatorfilter-test.cpp \
|
||||
matchingtext-test.cpp \
|
||||
mimedatabase-utilities.cpp \
|
||||
pchgenerator-test.cpp \
|
||||
@@ -68,6 +72,7 @@ SOURCES += \
|
||||
sourcerangefilter-test.cpp \
|
||||
spydummy.cpp \
|
||||
symbolindexer-test.cpp \
|
||||
symbolsfindfilter-test.cpp \
|
||||
stringcache-test.cpp \
|
||||
eventspy.cpp \
|
||||
unittests-main.cpp \
|
||||
|
Reference in New Issue
Block a user