aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coco/cocolanguageclient.h
blob: f4a48419bbb44b4bf0cab38a021e1b064f2898cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <languageclient/client.h>

namespace Coco {

class CocoLanguageClient : public LanguageClient::Client
{
public:
    CocoLanguageClient(const Utils::FilePath &coco, const Utils::FilePath &csmes);
    ~CocoLanguageClient() override;

    LanguageClient::BaseClientInterface *clientInterface(const Utils::FilePath &coco,
                                                         const Utils::FilePath &csmes);

protected:
    LanguageClient::DiagnosticManager *createDiagnosticManager() override;
    void handleDiagnostics(const LanguageServerProtocol::PublishDiagnosticsParams &params) override;

private:
    void initClientCapabilities();
    void onDocumentOpened(Core::IDocument *document);
    void onDocumentClosed(Core::IDocument *document);
    void handleEditorOpened(Core::IEditor *editor);
};

} // namespace Coco