File indexing completed on 2024-04-28 05:48:56

0001 /*
0002     SPDX-FileCopyrightText: 2019 Mark Nauwelaerts <mark.nauwelaerts@gmail.com>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #pragma once
0008 
0009 #include <KTextEditor/ConfigPage>
0010 
0011 class LSPClientPlugin;
0012 
0013 namespace Ui
0014 {
0015 class LspConfigWidget;
0016 }
0017 
0018 class LSPClientConfigPage : public KTextEditor::ConfigPage
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit LSPClientConfigPage(QWidget *parent = nullptr, LSPClientPlugin *plugin = nullptr);
0024     ~LSPClientConfigPage() override;
0025 
0026     QString name() const override;
0027     QString fullName() const override;
0028     QIcon icon() const override;
0029 
0030 public Q_SLOTS:
0031     void apply() override;
0032     void defaults() override;
0033     void reset() override;
0034     void configTextChanged();
0035     void configUrlChanged();
0036     void updateHighlighters();
0037     void showContextMenuAllowedBlocked(const QPoint &pos);
0038 
0039 private:
0040     void readUserConfig(const QString &fileName);
0041     void updateConfigTextErrorState();
0042 
0043     Ui::LspConfigWidget *ui;
0044     LSPClientPlugin *m_plugin;
0045 };