2023-04-13 22:25:47 +02:00
|
|
|
// 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>
|
2023-05-10 21:38:41 +02:00
|
|
|
|
|
|
|
|
#include <solutions/tasking/tasktree.h>
|
2023-04-13 22:25:47 +02:00
|
|
|
|
|
|
|
|
namespace LanguageClient {
|
|
|
|
|
|
|
|
|
|
class LANGUAGECLIENT_EXPORT CurrentDocumentSymbolsData
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Utils::FilePath m_filePath;
|
|
|
|
|
LanguageServerProtocol::DocumentUri::PathMapper m_pathMapper;
|
|
|
|
|
LanguageServerProtocol::DocumentSymbolsResult m_symbols;
|
|
|
|
|
};
|
|
|
|
|
|
2023-05-03 15:26:12 +02:00
|
|
|
class LANGUAGECLIENT_EXPORT CurrentDocumentSymbolsRequest : public QObject
|
2023-04-13 22:25:47 +02:00
|
|
|
{
|
|
|
|
|
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
|
2023-05-10 19:54:52 +02:00
|
|
|
: public Tasking::TaskAdapter<CurrentDocumentSymbolsRequest>
|
2023-04-13 22:25:47 +02:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CurrentDocumentSymbolsRequestTaskAdapter();
|
|
|
|
|
void start() final;
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-17 11:08:21 +02:00
|
|
|
using CurrentDocumentSymbolsRequestTask
|
|
|
|
|
= Tasking::CustomTask<CurrentDocumentSymbolsRequestTaskAdapter>;
|
2023-04-13 22:25:47 +02:00
|
|
|
|
2023-08-17 11:08:21 +02:00
|
|
|
} // namespace LanguageClient
|