Commit 17b33bab authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Don't subscribe for old textDocument/semanticHighlighting


Signed-off-by: Waqar Ahmed's avatarWaqar Ahmed <waqar.17a@gmail.com>
parent 45a32b17
......@@ -5,7 +5,6 @@
*/
#include "lspclientserver.h"
#include "lspclientplugin.h"
#include "lspclient_debug.h"
......@@ -1119,7 +1118,7 @@ private:
initialized();
}
void initialize(LSPClientPlugin *plugin)
void initialize()
{
QJsonObject codeAction{{QStringLiteral("codeActionLiteralSupport"),
QJsonObject{{QStringLiteral("codeActionKind"), QJsonObject{{QStringLiteral("valueSet"), QJsonArray()}}}}}};
......@@ -1129,9 +1128,7 @@ private:
QJsonObject{{QStringLiteral("hierarchicalDocumentSymbolSupport"), true}},
},
{QStringLiteral("publishDiagnostics"), QJsonObject{{QStringLiteral("relatedInformation"), true}}},
{QStringLiteral("codeAction"), codeAction},
{QStringLiteral("semanticHighlightingCapabilities"),
QJsonObject{{QStringLiteral("semanticHighlighting"), !plugin || plugin->m_semanticHighlighting}}}}}};
{QStringLiteral("codeAction"), codeAction}}}};
// NOTE a typical server does not use root all that much,
// other than for some corner case (in) requests
QJsonObject params{{QStringLiteral("processId"), QCoreApplication::applicationPid()},
......@@ -1150,7 +1147,7 @@ private:
}
public:
bool start(LSPClientPlugin *plugin)
bool start()
{
if (m_state != State::None) {
return true;
......@@ -1174,7 +1171,7 @@ public:
} else {
setState(State::Started);
// perform initial handshake
initialize(plugin);
initialize();
}
return result;
}
......@@ -1459,9 +1456,9 @@ const LSPServerCapabilities &LSPClientServer::capabilities() const
return d->capabilities();
}
bool LSPClientServer::start(LSPClientPlugin *plugin)
bool LSPClientServer::start()
{
return d->start(plugin);
return d->start();
}
void LSPClientServer::stop(int to_t, int to_k)
......
......@@ -98,7 +98,7 @@ public:
// server management
// request start
bool start(LSPClientPlugin *plugin);
bool start();
// request shutdown/stop
// if to_xxx >= 0 -> send signal if not exit'ed after timeout
void stop(int to_term_ms, int to_kill_ms);
......
......@@ -593,7 +593,7 @@ private:
if (cmdline.length() > 0) {
server.reset(new LSPClientServer(cmdline, root, realLangId, serverConfig.value(QStringLiteral("initializationOptions"))));
connect(server.data(), &LSPClientServer::stateChanged, this, &self_type::onStateChanged, Qt::UniqueConnection);
if (!server->start(m_plugin)) {
if (!server->start()) {
showMessage(i18n("Failed to start server: %1", cmdline.join(QLatin1Char(' '))), KTextEditor::Message::Error);
} else {
showMessage(i18n("Started server %2: %1", cmdline.join(QLatin1Char(' ')), serverDescription(server.data())),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment