Changeset View
Changeset View
Standalone View
Standalone View
addons/lspclient/lspclientplugin.cpp
Show All 20 Lines | 1 | /* SPDX-License-Identifier: MIT | |||
---|---|---|---|---|---|
21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
23 | */ | 23 | */ | ||
24 | 24 | | |||
25 | #include "lspclientplugin.h" | 25 | #include "lspclientplugin.h" | ||
26 | #include "lspclientpluginview.h" | 26 | #include "lspclientpluginview.h" | ||
27 | #include "lspclientconfigpage.h" | 27 | #include "lspclientconfigpage.h" | ||
28 | 28 | | |||
29 | #include "lspclient_debug.h" | ||||
30 | | ||||
29 | #include <KConfigGroup> | 31 | #include <KConfigGroup> | ||
30 | #include <KDirWatch> | 32 | #include <KDirWatch> | ||
31 | #include <KPluginFactory> | 33 | #include <KPluginFactory> | ||
32 | #include <KSharedConfig> | 34 | #include <KSharedConfig> | ||
33 | 35 | | |||
34 | #include <QDir> | 36 | #include <QDir> | ||
35 | 37 | | |||
36 | static const QString CONFIG_LSPCLIENT { QStringLiteral("lspclient") }; | 38 | static const QString CONFIG_LSPCLIENT { QStringLiteral("lspclient") }; | ||
Show All 9 Lines | |||||
46 | static const QString CONFIG_SERVER_CONFIG { QStringLiteral("ServerConfiguration") }; | 48 | static const QString CONFIG_SERVER_CONFIG { QStringLiteral("ServerConfiguration") }; | ||
47 | 49 | | |||
48 | 50 | | |||
49 | K_PLUGIN_FACTORY_WITH_JSON(LSPClientPluginFactory, "lspclientplugin.json", registerPlugin<LSPClientPlugin>();) | 51 | K_PLUGIN_FACTORY_WITH_JSON(LSPClientPluginFactory, "lspclientplugin.json", registerPlugin<LSPClientPlugin>();) | ||
50 | 52 | | |||
51 | LSPClientPlugin::LSPClientPlugin(QObject *parent, const QList<QVariant> &) | 53 | LSPClientPlugin::LSPClientPlugin(QObject *parent, const QList<QVariant> &) | ||
52 | : KTextEditor::Plugin(parent) | 54 | : KTextEditor::Plugin(parent) | ||
53 | { | 55 | { | ||
56 | /** | ||||
57 | * handle plugin verbosity | ||||
58 | * the m_debugMode will be used to e.g. set debug level for started clangd, too | ||||
59 | */ | ||||
60 | m_debugMode = (qgetenv("LSPCLIENT_DEBUG") == QByteArray("1")); | ||||
61 | if (!m_debugMode) { | ||||
62 | QLoggingCategory::setFilterRules(QStringLiteral("katelspclientplugin.debug=false\nkatelspclientplugin.info=false")); | ||||
63 | } | ||||
64 | | ||||
54 | readConfig(); | 65 | readConfig(); | ||
55 | } | 66 | } | ||
56 | 67 | | |||
57 | LSPClientPlugin::~LSPClientPlugin() | 68 | LSPClientPlugin::~LSPClientPlugin() | ||
58 | { | 69 | { | ||
59 | } | 70 | } | ||
60 | 71 | | |||
61 | QObject *LSPClientPlugin::createView(KTextEditor::MainWindow *mainWindow) | 72 | QObject *LSPClientPlugin::createView(KTextEditor::MainWindow *mainWindow) | ||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |