forked from qt-creator/qt-creator
ILocatorFilter: Provide default implementation for accept()
Change-Id: Ide3c65ac78da60c9634b8f1c3009e947e8f1e2f3 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -110,10 +110,8 @@ void BookmarkFilter::accept(const LocatorFilterEntry &selection, QString *newTex
|
|||||||
Q_UNUSED(newText)
|
Q_UNUSED(newText)
|
||||||
Q_UNUSED(selectionStart)
|
Q_UNUSED(selectionStart)
|
||||||
Q_UNUSED(selectionLength)
|
Q_UNUSED(selectionLength)
|
||||||
if (const Bookmark *bookmark = m_manager->bookmarkForIndex(
|
if (Bookmark *bookmark = m_manager->bookmarkForIndex(selection.internalData.toModelIndex()))
|
||||||
selection.internalData.toModelIndex())) {
|
|
||||||
m_manager->gotoBookmark(bookmark);
|
m_manager->gotoBookmark(bookmark);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Bookmarks::Internal
|
} // Bookmarks::Internal
|
||||||
|
@@ -168,16 +168,6 @@ QList<LocatorFilterEntry> ClangGlobalSymbolFilter::matchesFor(
|
|||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangGlobalSymbolFilter::accept(const LocatorFilterEntry &selection, QString *newText,
|
|
||||||
int *selectionStart, int *selectionLength) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(newText)
|
|
||||||
Q_UNUSED(selectionStart)
|
|
||||||
Q_UNUSED(selectionLength)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ClangClassesFilter::ClangClassesFilter()
|
ClangClassesFilter::ClangClassesFilter()
|
||||||
: ClangGlobalSymbolFilter(new CppClassesFilter, new LspClassesFilter)
|
: ClangGlobalSymbolFilter(new CppClassesFilter, new LspClassesFilter)
|
||||||
{
|
{
|
||||||
@@ -344,14 +334,5 @@ QList<LocatorFilterEntry> ClangdCurrentDocumentFilter::matchesFor(
|
|||||||
return d->activeFilter->matchesFor(future, entry);
|
return d->activeFilter->matchesFor(future, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangdCurrentDocumentFilter::accept(const LocatorFilterEntry &selection, QString *newText,
|
|
||||||
int *selectionStart, int *selectionLength) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(newText)
|
|
||||||
Q_UNUSED(selectionStart)
|
|
||||||
Q_UNUSED(selectionLength)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ClangCodeModel
|
} // namespace ClangCodeModel
|
||||||
|
@@ -22,9 +22,6 @@ private:
|
|||||||
void prepareSearch(const QString &entry) override;
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const Core::LocatorFilterEntry &selection, QString *newText,
|
|
||||||
int *selectionStart, int *selectionLength) const override;
|
|
||||||
|
|
||||||
Core::ILocatorFilter * const m_cppFilter;
|
Core::ILocatorFilter * const m_cppFilter;
|
||||||
LanguageClient::WorkspaceLocatorFilter * const m_lspFilter;
|
LanguageClient::WorkspaceLocatorFilter * const m_lspFilter;
|
||||||
};
|
};
|
||||||
@@ -53,9 +50,6 @@ private:
|
|||||||
void prepareSearch(const QString &entry) override;
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const Core::LocatorFilterEntry &selection, QString *newText,
|
|
||||||
int *selectionStart, int *selectionLength) const override;
|
|
||||||
|
|
||||||
class Private;
|
class Private;
|
||||||
Private * const d;
|
Private * const d;
|
||||||
};
|
};
|
||||||
|
@@ -8,8 +8,6 @@
|
|||||||
#include "cmakeproject.h"
|
#include "cmakeproject.h"
|
||||||
#include "cmakeprojectmanagertr.h"
|
#include "cmakeprojectmanagertr.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
|
||||||
|
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectmanager.h>
|
#include <projectexplorer/projectmanager.h>
|
||||||
@@ -147,15 +145,4 @@ OpenCMakeTargetLocatorFilter::OpenCMakeTargetLocatorFilter()
|
|||||||
setPriority(Medium);
|
setPriority(Medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenCMakeTargetLocatorFilter::accept(const LocatorFilterEntry &selection,
|
|
||||||
QString *newText,
|
|
||||||
int *selectionStart,
|
|
||||||
int *selectionLength) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(newText)
|
|
||||||
Q_UNUSED(selectionStart)
|
|
||||||
Q_UNUSED(selectionLength)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // CMakeProjectManager::Internal
|
} // CMakeProjectManager::Internal
|
||||||
|
@@ -37,11 +37,6 @@ class OpenCMakeTargetLocatorFilter : CMakeTargetLocatorFilter
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OpenCMakeTargetLocatorFilter();
|
OpenCMakeTargetLocatorFilter();
|
||||||
|
|
||||||
void accept(const Core::LocatorFilterEntry &selection,
|
|
||||||
QString *newText,
|
|
||||||
int *selectionStart,
|
|
||||||
int *selectionLength) const final;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // CMakeProjectManager::Internal
|
} // CMakeProjectManager::Internal
|
||||||
|
@@ -3,10 +3,8 @@
|
|||||||
|
|
||||||
#include "basefilefilter.h"
|
#include "basefilefilter.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
#include <utils/linecolumn.h>
|
|
||||||
#include <utils/link.h>
|
#include <utils/link.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -192,18 +190,6 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil
|
|||||||
return std::accumulate(std::begin(entries), std::end(entries), QList<LocatorFilterEntry>());
|
return std::accumulate(std::begin(entries), std::end(entries), QList<LocatorFilterEntry>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
\reimp
|
|
||||||
*/
|
|
||||||
void BaseFileFilter::accept(const LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(newText)
|
|
||||||
Q_UNUSED(selectionStart)
|
|
||||||
Q_UNUSED(selectionLength)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Takes ownership of the \a iterator. The previously set iterator might not be deleted until
|
Takes ownership of the \a iterator. The previously set iterator might not be deleted until
|
||||||
a currently running search is finished.
|
a currently running search is finished.
|
||||||
|
@@ -46,9 +46,6 @@ public:
|
|||||||
void prepareSearch(const QString &entry) override;
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setFileIterator(Iterator *iterator);
|
void setFileIterator(Iterator *iterator);
|
||||||
QSharedPointer<Iterator> fileIterator();
|
QSharedPointer<Iterator> fileIterator();
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
#include "ilocatorfilter.h"
|
#include "ilocatorfilter.h"
|
||||||
|
|
||||||
#include "../coreplugintr.h"
|
#include "../coreplugintr.h"
|
||||||
|
#include "../editormanager/editormanager.h"
|
||||||
|
|
||||||
#include <utils/fuzzymatcher.h>
|
#include <utils/fuzzymatcher.h>
|
||||||
|
|
||||||
@@ -98,6 +99,24 @@ void ILocatorFilter::prepareSearch(const QString &entry)
|
|||||||
Q_UNUSED(entry)
|
Q_UNUSED(entry)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called with the entry specified by \a selection when the user activates it
|
||||||
|
in the result list.
|
||||||
|
Implementations can return a new search term \a newText, which has \a selectionLength characters
|
||||||
|
starting from \a selectionStart preselected, and the cursor set to the end of the selection.
|
||||||
|
|
||||||
|
The default implementation tries to open an editor for \a selections's linkForEditor,
|
||||||
|
if it exists.
|
||||||
|
*/
|
||||||
|
void ILocatorFilter::accept(const LocatorFilterEntry &selection, QString *newText,
|
||||||
|
int *selectionStart, int *selectionLength) const
|
||||||
|
{
|
||||||
|
Q_UNUSED(newText)
|
||||||
|
Q_UNUSED(selectionStart)
|
||||||
|
Q_UNUSED(selectionLength)
|
||||||
|
EditorManager::openEditor(selection);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets the default \a shortcut string that can be used to explicitly choose
|
Sets the default \a shortcut string that can be used to explicitly choose
|
||||||
this filter in the locator input field. Call for example from the
|
this filter in the locator input field. Call for example from the
|
||||||
@@ -597,15 +616,6 @@ bool ILocatorFilter::isOldSetting(const QByteArray &state)
|
|||||||
\sa caseSensitivity()
|
\sa caseSensitivity()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void Core::ILocatorFilter::accept(Core::const LocatorFilterEntry &selection, QString *newText, int *selectionStart, int *selectionLength) const
|
|
||||||
|
|
||||||
Called with the entry specified by \a selection when the user activates it
|
|
||||||
in the result list.
|
|
||||||
Implementations can return a new search term \a newText, which has \a selectionLength characters
|
|
||||||
starting from \a selectionStart preselected, and the cursor set to the end of the selection.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void Core::ILocatorFilter::refresh(QFutureInterface<void> &future)
|
\fn void Core::ILocatorFilter::refresh(QFutureInterface<void> &future)
|
||||||
|
|
||||||
|
@@ -154,8 +154,8 @@ public:
|
|||||||
|
|
||||||
virtual QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry) = 0;
|
virtual QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry) = 0;
|
||||||
|
|
||||||
virtual void accept(const LocatorFilterEntry &selection,
|
virtual void accept(const LocatorFilterEntry &selection, QString *newText,
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const = 0;
|
int *selectionStart, int *selectionLength) const;
|
||||||
|
|
||||||
virtual void refresh(QFutureInterface<void> &future) { Q_UNUSED(future) };
|
virtual void refresh(QFutureInterface<void> &future) { Q_UNUSED(future) };
|
||||||
|
|
||||||
|
@@ -4,11 +4,9 @@
|
|||||||
#include "opendocumentsfilter.h"
|
#include "opendocumentsfilter.h"
|
||||||
|
|
||||||
#include "../coreplugintr.h"
|
#include "../coreplugintr.h"
|
||||||
#include "../editormanager/editormanager.h"
|
|
||||||
|
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
#include <utils/link.h>
|
#include <utils/link.h>
|
||||||
#include <utils/linecolumn.h>
|
|
||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QMutexLocker>
|
#include <QMutexLocker>
|
||||||
@@ -117,13 +115,4 @@ QList<OpenDocumentsFilter::Entry> OpenDocumentsFilter::editors() const
|
|||||||
return m_editors;
|
return m_editors;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenDocumentsFilter::accept(const LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(newText)
|
|
||||||
Q_UNUSED(selectionStart)
|
|
||||||
Q_UNUSED(selectionLength)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Core::Internal
|
} // Core::Internal
|
||||||
|
@@ -23,9 +23,6 @@ public:
|
|||||||
OpenDocumentsFilter();
|
OpenDocumentsFilter();
|
||||||
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
|
||||||
const QVector<int> &roles);
|
const QVector<int> &roles);
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <coreplugin/idocument.h>
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
@@ -138,15 +137,6 @@ QList<LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(
|
|||||||
return betterEntries;
|
return betterEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppCurrentDocumentFilter::accept(const LocatorFilterEntry &selection, QString *newText,
|
|
||||||
int *selectionStart, int *selectionLength) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(newText)
|
|
||||||
Q_UNUSED(selectionStart)
|
|
||||||
Q_UNUSED(selectionLength)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppCurrentDocumentFilter::onDocumentUpdated(Document::Ptr doc)
|
void CppCurrentDocumentFilter::onDocumentUpdated(Document::Ptr doc)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&m_mutex);
|
QMutexLocker locker(&m_mutex);
|
||||||
|
@@ -27,9 +27,6 @@ public:
|
|||||||
|
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const Core::LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onDocumentUpdated(CPlusPlus::Document::Ptr doc);
|
void onDocumentUpdated(CPlusPlus::Document::Ptr doc);
|
||||||
void onCurrentEditorChanged(Core::IEditor *currentEditor);
|
void onCurrentEditorChanged(Core::IEditor *currentEditor);
|
||||||
|
@@ -6,14 +6,10 @@
|
|||||||
#include "cppeditorconstants.h"
|
#include "cppeditorconstants.h"
|
||||||
#include "cppeditortr.h"
|
#include "cppeditortr.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <numeric>
|
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
namespace CppEditor {
|
namespace CppEditor {
|
||||||
@@ -116,15 +112,6 @@ QList<LocatorFilterEntry> CppLocatorFilter::matchesFor(
|
|||||||
return std::accumulate(std::begin(entries), std::end(entries), QList<LocatorFilterEntry>());
|
return std::accumulate(std::begin(entries), std::end(entries), QList<LocatorFilterEntry>());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppLocatorFilter::accept(const LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(newText)
|
|
||||||
Q_UNUSED(selectionStart)
|
|
||||||
Q_UNUSED(selectionLength)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
CppClassesFilter::CppClassesFilter(CppLocatorData *locatorData)
|
CppClassesFilter::CppClassesFilter(CppLocatorData *locatorData)
|
||||||
: CppLocatorFilter(locatorData)
|
: CppLocatorFilter(locatorData)
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "cppeditor_global.h"
|
#include "cppeditor_global.h"
|
||||||
#include "cpplocatordata.h"
|
#include "cpplocatordata.h"
|
||||||
#include "searchsymbols.h"
|
|
||||||
|
|
||||||
#include <coreplugin/locator/ilocatorfilter.h>
|
#include <coreplugin/locator/ilocatorfilter.h>
|
||||||
|
|
||||||
@@ -21,9 +20,6 @@ public:
|
|||||||
|
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const Core::LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual IndexItem::ItemType matchTypes() const { return IndexItem::All; }
|
virtual IndexItem::ItemType matchTypes() const { return IndexItem::All; }
|
||||||
virtual Core::LocatorFilterEntry filterEntryFromIndexItem(IndexItem::Ptr info);
|
virtual Core::LocatorFilterEntry filterEntryFromIndexItem(IndexItem::Ptr info);
|
||||||
|
@@ -7,18 +7,14 @@
|
|||||||
#include "languageclient_global.h"
|
#include "languageclient_global.h"
|
||||||
#include "languageclientmanager.h"
|
#include "languageclientmanager.h"
|
||||||
#include "languageclienttr.h"
|
#include "languageclienttr.h"
|
||||||
#include "languageclientutils.h"
|
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
#include <languageserverprotocol/lsptypes.h>
|
#include <languageserverprotocol/lsptypes.h>
|
||||||
#include <languageserverprotocol/servercapabilities.h>
|
|
||||||
|
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
#include <texteditor/texteditor.h>
|
|
||||||
|
|
||||||
#include <utils/fuzzymatcher.h>
|
#include <utils/fuzzymatcher.h>
|
||||||
#include <utils/linecolumn.h>
|
|
||||||
|
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
@@ -204,15 +200,6 @@ QList<LocatorFilterEntry> DocumentLocatorFilter::matchesFor(
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentLocatorFilter::accept(const LocatorFilterEntry &selection,
|
|
||||||
QString * /*newText*/,
|
|
||||||
int * /*selectionStart*/,
|
|
||||||
int * /*selectionLength*/) const
|
|
||||||
{
|
|
||||||
if (selection.linkForEditor)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
WorkspaceLocatorFilter::WorkspaceLocatorFilter()
|
WorkspaceLocatorFilter::WorkspaceLocatorFilter()
|
||||||
: WorkspaceLocatorFilter(QVector<SymbolKind>())
|
: WorkspaceLocatorFilter(QVector<SymbolKind>())
|
||||||
{}
|
{}
|
||||||
@@ -302,14 +289,6 @@ QList<LocatorFilterEntry> WorkspaceLocatorFilter::matchesFor(
|
|||||||
return Utils::transform(m_results, generateEntry).toList();
|
return Utils::transform(m_results, generateEntry).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorkspaceLocatorFilter::accept(const LocatorFilterEntry &selection,
|
|
||||||
QString * /*newText*/,
|
|
||||||
int * /*selectionStart*/,
|
|
||||||
int * /*selectionLength*/) const
|
|
||||||
{
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WorkspaceLocatorFilter::handleResponse(Client *client,
|
void WorkspaceLocatorFilter::handleResponse(Client *client,
|
||||||
const WorkspaceSymbolRequest::Response &response)
|
const WorkspaceSymbolRequest::Response &response)
|
||||||
{
|
{
|
||||||
|
@@ -29,11 +29,6 @@ public:
|
|||||||
void prepareSearch(const QString &entry) override;
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const Core::LocatorFilterEntry &selection,
|
|
||||||
QString *newText,
|
|
||||||
int *selectionStart,
|
|
||||||
int *selectionLength) const override;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void symbolsUpToDate(QPrivateSignal);
|
void symbolsUpToDate(QPrivateSignal);
|
||||||
|
|
||||||
@@ -85,11 +80,6 @@ public:
|
|||||||
void prepareSearch(const QString &entry, const QList<Client *> &clients);
|
void prepareSearch(const QString &entry, const QList<Client *> &clients);
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const Core::LocatorFilterEntry &selection,
|
|
||||||
QString *newText,
|
|
||||||
int *selectionStart,
|
|
||||||
int *selectionLength) const override;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void allRequestsFinished(QPrivateSignal);
|
void allRequestsFinished(QPrivateSignal);
|
||||||
|
|
||||||
|
@@ -5,13 +5,10 @@
|
|||||||
#include "qmljslocatordata.h"
|
#include "qmljslocatordata.h"
|
||||||
#include "qmljstoolstr.h"
|
#include "qmljstoolstr.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#include <numeric>
|
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QmlJSTools::Internal;
|
using namespace QmlJSTools::Internal;
|
||||||
|
|
||||||
@@ -72,12 +69,3 @@ QList<LocatorFilterEntry> FunctionFilter::matchesFor(QFutureInterface<LocatorFil
|
|||||||
}
|
}
|
||||||
return std::accumulate(std::begin(entries), std::end(entries), QList<LocatorFilterEntry>());
|
return std::accumulate(std::begin(entries), std::end(entries), QList<LocatorFilterEntry>());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FunctionFilter::accept(const LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(newText)
|
|
||||||
Q_UNUSED(selectionStart)
|
|
||||||
Q_UNUSED(selectionLength)
|
|
||||||
EditorManager::openEditor(selection);
|
|
||||||
}
|
|
||||||
|
@@ -20,9 +20,6 @@ public:
|
|||||||
|
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry) override;
|
const QString &entry) override;
|
||||||
void accept(const Core::LocatorFilterEntry &selection,
|
|
||||||
QString *newText, int *selectionStart, int *selectionLength) const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LocatorData *m_data = nullptr;
|
LocatorData *m_data = nullptr;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user