mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-15 15:42:52 +00:00
This feels like a better name since the "autocomplete engine" can, in addition to providing autocomplete suggestions, also find declarations of symbols and report back the symbols that are defined in a document. Also, Cpp/ParserAutoComplete has been renamed to CppComprehensionEngine and Shell/AutoComplete has been renamed to ShellComprehensionEngine.
29 lines
908 B
C++
29 lines
908 B
C++
/*
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "CppComprehensionEngine.h"
|
|
#include <DevTools/HackStudio/LanguageServers/ClientConnection.h>
|
|
|
|
namespace LanguageServers::Cpp {
|
|
|
|
class ClientConnection final : public LanguageServers::ClientConnection {
|
|
C_OBJECT(ClientConnection);
|
|
|
|
public:
|
|
ClientConnection(NonnullRefPtr<Core::LocalSocket> socket, int client_id)
|
|
: LanguageServers::ClientConnection(move(socket), client_id)
|
|
{
|
|
m_autocomplete_engine = make<CppComprehensionEngine>(m_filedb);
|
|
m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
|
|
async_declarations_in_document(filename, move(declarations));
|
|
};
|
|
}
|
|
|
|
virtual ~ClientConnection() override = default;
|
|
};
|
|
}
|