Commit 288cc434 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

lspclient: minor constant cleanup

parent 5c119e40
......@@ -29,6 +29,15 @@
#include <QDir>
static const QString CONFIG_LSPCLIENT { QStringLiteral("lspclient") };
static const QString CONFIG_SYMBOL_DETAILS { QStringLiteral("SymbolDetails") };
static const QString CONFIG_SYMBOL_TREE { QStringLiteral("SymbolTree") };
static const QString CONFIG_SYMBOL_EXPAND { QStringLiteral("SymbolExpand") };
static const QString CONFIG_SYMBOL_SORT { QStringLiteral("SymbolSort") };
static const QString CONFIG_COMPLETION_DOC { QStringLiteral("CompletionDocumentation") };
static const QString CONFIG_SERVER_CONFIG { QStringLiteral("ServerConfiguration") };
K_PLUGIN_FACTORY_WITH_JSON(LSPClientPluginFactory, "lspclientplugin.json", registerPlugin<LSPClientPlugin>();)
LSPClientPlugin::LSPClientPlugin(QObject *parent, const QList<QVariant> &)
......@@ -62,26 +71,26 @@ KTextEditor::ConfigPage *LSPClientPlugin::configPage(int number, QWidget *parent
void LSPClientPlugin::readConfig()
{
KConfigGroup config(KSharedConfig::openConfig(), QStringLiteral("lspclient"));
m_symbolDetails = config.readEntry(QStringLiteral("SymbolDetails"), false);
m_symbolTree = config.readEntry(QStringLiteral("SymbolTree"), true);
m_symbolExpand = config.readEntry(QStringLiteral("SymbolExpand"), true);
m_symbolSort = config.readEntry(QStringLiteral("SymbolSort"), false);
m_complDoc = config.readEntry(QStringLiteral("CompletionDocumentation"), true);
m_configPath = config.readEntry(QStringLiteral("ServerConfiguration"), QUrl());
KConfigGroup config(KSharedConfig::openConfig(), CONFIG_LSPCLIENT);
m_symbolDetails = config.readEntry(CONFIG_SYMBOL_DETAILS, false);
m_symbolTree = config.readEntry(CONFIG_SYMBOL_TREE, true);
m_symbolExpand = config.readEntry(CONFIG_SYMBOL_EXPAND, true);
m_symbolSort = config.readEntry(CONFIG_SYMBOL_SORT, false);
m_complDoc = config.readEntry(CONFIG_COMPLETION_DOC, true);
m_configPath = config.readEntry(CONFIG_SERVER_CONFIG, QUrl());
emit update();
}
void LSPClientPlugin::writeConfig() const
{
KConfigGroup config(KSharedConfig::openConfig(), QStringLiteral("lspclient"));
config.writeEntry(QStringLiteral("SymbolDetails"), m_symbolDetails);
config.writeEntry(QStringLiteral("SymbolTree"), m_symbolTree);
config.writeEntry(QStringLiteral("SymbolExpand"), m_symbolExpand);
config.writeEntry(QStringLiteral("SymbolSort"), m_symbolSort);
config.writeEntry(QStringLiteral("CompletionDocumentation"), m_complDoc);
config.writeEntry(QStringLiteral("ServerConfiguration"), m_configPath);
KConfigGroup config(KSharedConfig::openConfig(), CONFIG_LSPCLIENT);
config.writeEntry(CONFIG_SYMBOL_DETAILS, m_symbolDetails);
config.writeEntry(CONFIG_SYMBOL_TREE, m_symbolTree);
config.writeEntry(CONFIG_SYMBOL_EXPAND, m_symbolExpand);
config.writeEntry(CONFIG_SYMBOL_SORT, m_symbolSort);
config.writeEntry(CONFIG_COMPLETION_DOC, m_complDoc);
config.writeEntry(CONFIG_SERVER_CONFIG, m_configPath);
emit update();
}
......
......@@ -31,28 +31,28 @@
#include <QCoreApplication>
#include <QTime>
static QString MEMBER_ID = QStringLiteral("id");
static QString MEMBER_METHOD = QStringLiteral("method");
static QString MEMBER_ERROR = QStringLiteral("error");
static QString MEMBER_CODE = QStringLiteral("code");
static QString MEMBER_MESSAGE = QStringLiteral("message");
static QString MEMBER_PARAMS = QStringLiteral("params");
static QString MEMBER_RESULT = QStringLiteral("result");
static QString MEMBER_URI = QStringLiteral("uri");
static QString MEMBER_VERSION = QStringLiteral("version");
static QString MEMBER_START = QStringLiteral("start");
static QString MEMBER_END = QStringLiteral("end");
static QString MEMBER_POSITION = QStringLiteral("position");
static QString MEMBER_LOCATION = QStringLiteral("location");
static QString MEMBER_RANGE = QStringLiteral("range");
static QString MEMBER_LINE = QStringLiteral("line");
static QString MEMBER_CHARACTER = QStringLiteral("character");
static QString MEMBER_KIND = QStringLiteral("kind");
static QString MEMBER_TEXT = QStringLiteral("text");
static QString MEMBER_LANGID = QStringLiteral("languageId");
static QString MEMBER_LABEL = QStringLiteral("label");
static QString MEMBER_DOCUMENTATION = QStringLiteral("documentation");
static QString MEMBER_DETAIL = QStringLiteral("detail");
static const QString MEMBER_ID = QStringLiteral("id");
static const QString MEMBER_METHOD = QStringLiteral("method");
static const QString MEMBER_ERROR = QStringLiteral("error");
static const QString MEMBER_CODE = QStringLiteral("code");
static const QString MEMBER_MESSAGE = QStringLiteral("message");
static const QString MEMBER_PARAMS = QStringLiteral("params");
static const QString MEMBER_RESULT = QStringLiteral("result");
static const QString MEMBER_URI = QStringLiteral("uri");
static const QString MEMBER_VERSION = QStringLiteral("version");
static const QString MEMBER_START = QStringLiteral("start");
static const QString MEMBER_END = QStringLiteral("end");
static const QString MEMBER_POSITION = QStringLiteral("position");
static const QString MEMBER_LOCATION = QStringLiteral("location");
static const QString MEMBER_RANGE = QStringLiteral("range");
static const QString MEMBER_LINE = QStringLiteral("line");
static const QString MEMBER_CHARACTER = QStringLiteral("character");
static const QString MEMBER_KIND = QStringLiteral("kind");
static const QString MEMBER_TEXT = QStringLiteral("text");
static const QString MEMBER_LANGID = QStringLiteral("languageId");
static const QString MEMBER_LABEL = QStringLiteral("label");
static const QString MEMBER_DOCUMENTATION = QStringLiteral("documentation");
static const QString MEMBER_DETAIL = QStringLiteral("detail");
// message construction helpers
static QJsonObject
......
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