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:
Ivan Donchevskii
2017-11-24 10:46:31 +01:00
parent cf7f898db3
commit 92cdfc0c2a
40 changed files with 1230 additions and 52 deletions

View File

@@ -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

View File

@@ -62,6 +62,8 @@ QtcPlugin {
"clangcompletioncontextanalyzer.cpp",
"clangcompletioncontextanalyzer.h",
"clangconstants.h",
"clangcurrentdocumentfilter.cpp",
"clangcurrentdocumentfilter.h",
"clangdiagnosticfilter.cpp",
"clangdiagnosticfilter.h",
"clangdiagnosticmanager.cpp",

View 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

View 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

View File

@@ -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>