forked from qt-creator/qt-creator
LanguageClient: Export ProgressManager
Change-Id: I737b7097878aacf9d1cf5b72af05b1471ab36891 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
#include <languageclient/languageclientmanager.h>
|
#include <languageclient/languageclientmanager.h>
|
||||||
#include <languageclient/languageclientsymbolsupport.h>
|
#include <languageclient/languageclientsymbolsupport.h>
|
||||||
#include <languageclient/languageclientutils.h>
|
#include <languageclient/languageclientutils.h>
|
||||||
|
#include <languageclient/progressmanager.h>
|
||||||
#include <languageserverprotocol/clientcapabilities.h>
|
#include <languageserverprotocol/clientcapabilities.h>
|
||||||
#include <languageserverprotocol/progresssupport.h>
|
#include <languageserverprotocol/progresssupport.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
@@ -413,10 +414,10 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir, c
|
|||||||
setClientCapabilities(caps);
|
setClientCapabilities(caps);
|
||||||
setLocatorsEnabled(false);
|
setLocatorsEnabled(false);
|
||||||
setAutoRequestCodeActions(false); // clangd sends code actions inside diagnostics
|
setAutoRequestCodeActions(false); // clangd sends code actions inside diagnostics
|
||||||
setProgressTitleForToken(indexingToken(),
|
progressManager()->setTitleForToken(indexingToken(),
|
||||||
project ? tr("Indexing %1 with clangd").arg(project->displayName())
|
project ? tr("Indexing %1 with clangd").arg(project->displayName())
|
||||||
: tr("Indexing session with clangd"));
|
: tr("Indexing session with clangd"));
|
||||||
setClickHandlerForToken(indexingToken(), [] {
|
progressManager()->setClickHandlerForToken(indexingToken(), [] {
|
||||||
// don't directly open modal dialog from click handler, because that would mess
|
// don't directly open modal dialog from click handler, because that would mess
|
||||||
// up the stack
|
// up the stack
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(
|
||||||
|
@@ -1572,16 +1572,9 @@ void Client::setError(const QString &message)
|
|||||||
d->m_state = Error;
|
d->m_state = Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::setProgressTitleForToken(const LanguageServerProtocol::ProgressToken &token,
|
ProgressManager *Client::progressManager()
|
||||||
const QString &message)
|
|
||||||
{
|
{
|
||||||
d->m_progressManager.setTitleForToken(token, message);
|
return &d->m_progressManager;
|
||||||
}
|
|
||||||
|
|
||||||
void Client::setClickHandlerForToken(const LanguageServerProtocol::ProgressToken &token,
|
|
||||||
const std::function<void()> &handler)
|
|
||||||
{
|
|
||||||
d->m_progressManager.setClickHandlerForToken(token, handler);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::handleMessage(const LanguageServerProtocol::JsonRpcMessage &message)
|
void Client::handleMessage(const LanguageServerProtocol::JsonRpcMessage &message)
|
||||||
|
@@ -42,6 +42,7 @@ class InterfaceController;
|
|||||||
class LanguageClientCompletionAssistProvider;
|
class LanguageClientCompletionAssistProvider;
|
||||||
class LanguageClientQuickFixProvider;
|
class LanguageClientQuickFixProvider;
|
||||||
class LanguageFilter;
|
class LanguageFilter;
|
||||||
|
class ProgressManager;
|
||||||
class SymbolSupport;
|
class SymbolSupport;
|
||||||
|
|
||||||
class LANGUAGECLIENT_EXPORT Client : public QObject
|
class LANGUAGECLIENT_EXPORT Client : public QObject
|
||||||
@@ -199,10 +200,7 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setError(const QString &message);
|
void setError(const QString &message);
|
||||||
void setProgressTitleForToken(const LanguageServerProtocol::ProgressToken &token,
|
ProgressManager *progressManager();
|
||||||
const QString &message);
|
|
||||||
void setClickHandlerForToken(const LanguageServerProtocol::ProgressToken &token,
|
|
||||||
const std::function<void()> &handler);
|
|
||||||
void handleMessage(const LanguageServerProtocol::JsonRpcMessage &message);
|
void handleMessage(const LanguageServerProtocol::JsonRpcMessage &message);
|
||||||
virtual void handleDiagnostics(const LanguageServerProtocol::PublishDiagnosticsParams ¶ms);
|
virtual void handleDiagnostics(const LanguageServerProtocol::PublishDiagnosticsParams ¶ms);
|
||||||
virtual DiagnosticManager *createDiagnosticManager();
|
virtual DiagnosticManager *createDiagnosticManager();
|
||||||
|
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "languageclient_global.h"
|
||||||
|
|
||||||
#include <coreplugin/progressmanager/futureprogress.h>
|
#include <coreplugin/progressmanager/futureprogress.h>
|
||||||
|
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
@@ -19,7 +21,7 @@ class WorkDoneProgressEnd;
|
|||||||
|
|
||||||
namespace LanguageClient {
|
namespace LanguageClient {
|
||||||
|
|
||||||
class ProgressManager
|
class LANGUAGECLIENT_EXPORT ProgressManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProgressManager();
|
ProgressManager();
|
||||||
|
Reference in New Issue
Block a user