forked from qt-creator/qt-creator
Alias task types manually. Don't require the alias to be inside the Tasking namespace. Addresses the 22th point of the jira ticket below. Task-number: QTCREATORBUG-28741 Change-Id: I1bdda7fe5a01e4bcb5052ec328f4e0eace878651 Reviewed-by: hjk <hjk@qt.io>
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
// Copyright (C) 2023 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
#pragma once
|
|
|
|
#include "languageclient_global.h"
|
|
|
|
#include <languageserverprotocol/languagefeatures.h>
|
|
#include <languageserverprotocol/lsptypes.h>
|
|
|
|
#include <solutions/tasking/tasktree.h>
|
|
|
|
namespace LanguageClient {
|
|
|
|
class LANGUAGECLIENT_EXPORT CurrentDocumentSymbolsData
|
|
{
|
|
public:
|
|
Utils::FilePath m_filePath;
|
|
LanguageServerProtocol::DocumentUri::PathMapper m_pathMapper;
|
|
LanguageServerProtocol::DocumentSymbolsResult m_symbols;
|
|
};
|
|
|
|
class LANGUAGECLIENT_EXPORT CurrentDocumentSymbolsRequest : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
void start();
|
|
bool isRunning() const;
|
|
CurrentDocumentSymbolsData currentDocumentSymbolsData() const { return m_currentDocumentSymbolsData; }
|
|
|
|
signals:
|
|
void done(bool success);
|
|
|
|
private:
|
|
void clearConnections();
|
|
|
|
CurrentDocumentSymbolsData m_currentDocumentSymbolsData;
|
|
QList<QMetaObject::Connection> m_connections;
|
|
};
|
|
|
|
class LANGUAGECLIENT_EXPORT CurrentDocumentSymbolsRequestTaskAdapter
|
|
: public Tasking::TaskAdapter<CurrentDocumentSymbolsRequest>
|
|
{
|
|
public:
|
|
CurrentDocumentSymbolsRequestTaskAdapter();
|
|
void start() final;
|
|
};
|
|
|
|
using CurrentDocumentSymbolsRequestTask
|
|
= Tasking::CustomTask<CurrentDocumentSymbolsRequestTaskAdapter>;
|
|
|
|
} // namespace LanguageClient
|