2020-09-28 16:37:37 +03:00
|
|
|
/*
|
2021-03-02 09:40:10 +03:30
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
2020-09-28 16:37:37 +03:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-09-28 16:37:37 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-05-16 17:25:24 +03:00
|
|
|
#include "CppComprehensionEngine.h"
|
2021-03-02 09:40:10 +03:30
|
|
|
#include <DevTools/HackStudio/LanguageServers/ClientConnection.h>
|
2020-10-03 16:30:16 +03:30
|
|
|
|
2020-09-28 16:37:37 +03:00
|
|
|
namespace LanguageServers::Cpp {
|
|
|
|
|
|
2021-03-02 09:40:10 +03:30
|
|
|
class ClientConnection final : public LanguageServers::ClientConnection {
|
2020-09-28 16:37:37 +03:00
|
|
|
C_OBJECT(ClientConnection);
|
|
|
|
|
|
|
|
|
|
public:
|
2021-03-02 09:40:10 +03:30
|
|
|
ClientConnection(NonnullRefPtr<Core::LocalSocket> socket, int client_id)
|
|
|
|
|
: LanguageServers::ClientConnection(move(socket), client_id)
|
|
|
|
|
{
|
2021-05-16 17:25:24 +03:00
|
|
|
m_autocomplete_engine = make<CppComprehensionEngine>(m_filedb);
|
2021-05-14 10:20:17 +03:00
|
|
|
m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
|
|
|
|
|
async_declarations_in_document(filename, move(declarations));
|
|
|
|
|
};
|
2021-05-17 22:19:50 +02:00
|
|
|
m_autocomplete_engine->set_todo_entries_of_document_callback = [this](const String& filename, Vector<String>&& todo_entries) {
|
|
|
|
|
async_todo_entries_in_document(filename, move(todo_entries));
|
|
|
|
|
};
|
2021-03-02 09:40:10 +03:30
|
|
|
}
|
2020-09-28 16:37:37 +03:00
|
|
|
|
2021-03-02 09:40:10 +03:30
|
|
|
virtual ~ClientConnection() override = default;
|
2020-09-28 16:37:37 +03:00
|
|
|
};
|
|
|
|
|
}
|