1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:37:45 +00:00

Userland: Rename IPC ClientConnection => ConnectionFromClient

This was done with CLion's automatic rename feature and with:
find . -name ClientConnection.h
    | rename 's/ClientConnection\.h/ConnectionFromClient.h/'

find . -name ClientConnection.cpp
    | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
This commit is contained in:
Itamar 2022-02-25 12:18:30 +02:00 committed by Andreas Kling
parent efac862570
commit 3a71748e5d
137 changed files with 896 additions and 896 deletions

View file

@ -3,7 +3,7 @@ compile_ipc(LanguageClient.ipc LanguageClientEndpoint.h)
set(SOURCES
CodeComprehensionEngine.cpp
ClientConnection.cpp
ConnectionFromClient.cpp
FileDB.cpp)
set(GENERATED_SOURCES
LanguageClientEndpoint.h

View file

@ -14,7 +14,7 @@
namespace LanguageServers {
class ClientConnection;
class ConnectionFromClient;
class CodeComprehensionEngine {
public:

View file

@ -5,7 +5,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include <AK/Debug.h>
#include <AK/HashMap.h>
#include <LibCore/File.h>
@ -13,21 +13,21 @@
namespace LanguageServers {
static HashMap<int, RefPtr<ClientConnection>> s_connections;
static HashMap<int, RefPtr<ConnectionFromClient>> s_connections;
ClientConnection::ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
: IPC::ClientConnection<LanguageClientEndpoint, LanguageServerEndpoint>(*this, move(socket), 1)
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
: IPC::ConnectionFromClient<LanguageClientEndpoint, LanguageServerEndpoint>(*this, move(socket), 1)
{
s_connections.set(1, *this);
}
void ClientConnection::die()
void ConnectionFromClient::die()
{
s_connections.remove(client_id());
exit(0);
}
void ClientConnection::greet(String const& project_root)
void ConnectionFromClient::greet(String const& project_root)
{
m_filedb.set_project_root(project_root);
if (unveil(project_root.characters(), "r") < 0) {
@ -40,7 +40,7 @@ void ClientConnection::greet(String const& project_root)
}
}
void ClientConnection::file_opened(String const& filename, IPC::File const& file)
void ConnectionFromClient::file_opened(String const& filename, IPC::File const& file)
{
if (m_filedb.is_open(filename)) {
return;
@ -49,7 +49,7 @@ void ClientConnection::file_opened(String const& filename, IPC::File const& file
m_autocomplete_engine->file_opened(filename);
}
void ClientConnection::file_edit_insert_text(String const& filename, String const& text, i32 start_line, i32 start_column)
void ConnectionFromClient::file_edit_insert_text(String const& filename, String const& text, i32 start_line, i32 start_column)
{
dbgln_if(LANGUAGE_SERVER_DEBUG, "InsertText for file: {}", filename);
dbgln_if(LANGUAGE_SERVER_DEBUG, "Text: {}", text);
@ -58,7 +58,7 @@ void ClientConnection::file_edit_insert_text(String const& filename, String cons
m_autocomplete_engine->on_edit(filename);
}
void ClientConnection::file_edit_remove_text(String const& filename, i32 start_line, i32 start_column, i32 end_line, i32 end_column)
void ConnectionFromClient::file_edit_remove_text(String const& filename, i32 start_line, i32 start_column, i32 end_line, i32 end_column)
{
dbgln_if(LANGUAGE_SERVER_DEBUG, "RemoveText for file: {}", filename);
dbgln_if(LANGUAGE_SERVER_DEBUG, "[{}:{} - {}:{}]", start_line, start_column, end_line, end_column);
@ -66,7 +66,7 @@ void ClientConnection::file_edit_remove_text(String const& filename, i32 start_l
m_autocomplete_engine->on_edit(filename);
}
void ClientConnection::auto_complete_suggestions(GUI::AutocompleteProvider::ProjectLocation const& location)
void ConnectionFromClient::auto_complete_suggestions(GUI::AutocompleteProvider::ProjectLocation const& location)
{
dbgln_if(LANGUAGE_SERVER_DEBUG, "AutoCompleteSuggestions for: {} {}:{}", location.file, location.line, location.column);
@ -81,7 +81,7 @@ void ClientConnection::auto_complete_suggestions(GUI::AutocompleteProvider::Proj
async_auto_complete_suggestions(move(suggestions));
}
void ClientConnection::set_file_content(String const& filename, String const& content)
void ConnectionFromClient::set_file_content(String const& filename, String const& content)
{
dbgln_if(LANGUAGE_SERVER_DEBUG, "SetFileContent: {}", filename);
auto document = m_filedb.get(filename);
@ -95,7 +95,7 @@ void ClientConnection::set_file_content(String const& filename, String const& co
m_autocomplete_engine->on_edit(filename);
}
void ClientConnection::find_declaration(GUI::AutocompleteProvider::ProjectLocation const& location)
void ConnectionFromClient::find_declaration(GUI::AutocompleteProvider::ProjectLocation const& location)
{
dbgln_if(LANGUAGE_SERVER_DEBUG, "FindDeclaration: {} {}:{}", location.file, location.line, location.column);
auto document = m_filedb.get(location.file);
@ -115,7 +115,7 @@ void ClientConnection::find_declaration(GUI::AutocompleteProvider::ProjectLocati
async_declaration_location(GUI::AutocompleteProvider::ProjectLocation { decl_location.value().file, decl_location.value().line, decl_location.value().column });
}
void ClientConnection::get_parameters_hint(GUI::AutocompleteProvider::ProjectLocation const& location)
void ConnectionFromClient::get_parameters_hint(GUI::AutocompleteProvider::ProjectLocation const& location)
{
dbgln_if(LANGUAGE_SERVER_DEBUG, "GetParametersHint: {} {}:{}", location.file, location.line, location.column);
auto document = m_filedb.get(location.file);
@ -140,7 +140,7 @@ void ClientConnection::get_parameters_hint(GUI::AutocompleteProvider::ProjectLoc
async_parameters_hint_result(params->params, params->current_index);
}
void ClientConnection::get_tokens_info(String const& filename)
void ConnectionFromClient::get_tokens_info(String const& filename)
{
dbgln_if(LANGUAGE_SERVER_DEBUG, "GetTokenInfo: {}", filename);
auto document = m_filedb.get(filename);

View file

@ -12,17 +12,17 @@
#include "FileDB.h"
#include <AK/HashMap.h>
#include <AK/LexicalPath.h>
#include <LibIPC/ClientConnection.h>
#include <LibIPC/ConnectionFromClient.h>
#include <Userland/DevTools/HackStudio/LanguageServers/LanguageClientEndpoint.h>
#include <Userland/DevTools/HackStudio/LanguageServers/LanguageServerEndpoint.h>
namespace LanguageServers {
class ClientConnection : public IPC::ClientConnection<LanguageClientEndpoint, LanguageServerEndpoint> {
class ConnectionFromClient : public IPC::ConnectionFromClient<LanguageClientEndpoint, LanguageServerEndpoint> {
public:
explicit ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket>);
~ClientConnection() override = default;
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>);
~ConnectionFromClient() override = default;
virtual void die() override;

View file

@ -7,16 +7,16 @@
#pragma once
#include "CppComprehensionEngine.h"
#include <DevTools/HackStudio/LanguageServers/ClientConnection.h>
#include <DevTools/HackStudio/LanguageServers/ConnectionFromClient.h>
namespace LanguageServers::Cpp {
class ClientConnection final : public LanguageServers::ClientConnection {
C_OBJECT(ClientConnection);
class ConnectionFromClient final : public LanguageServers::ConnectionFromClient {
C_OBJECT(ConnectionFromClient);
private:
ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
: LanguageServers::ClientConnection(move(socket))
ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
: LanguageServers::ConnectionFromClient(move(socket))
{
m_autocomplete_engine = make<CppComprehensionEngine>(m_filedb);
m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
@ -27,6 +27,6 @@ private:
};
}
virtual ~ClientConnection() override = default;
virtual ~ConnectionFromClient() override = default;
};
}

View file

@ -16,7 +16,7 @@
#include <LibCpp/Parser.h>
#include <LibCpp/Preprocessor.h>
#include <LibRegex/Regex.h>
#include <Userland/DevTools/HackStudio/LanguageServers/ClientConnection.h>
#include <Userland/DevTools/HackStudio/LanguageServers/ConnectionFromClient.h>
namespace LanguageServers::Cpp {

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include "Tests.h"
#include <LibCore/ArgsParser.h>
#include <LibCore/EventLoop.h>
@ -34,7 +34,7 @@ ErrorOr<int> mode_server()
Core::EventLoop event_loop;
TRY(Core::System::pledge("stdio unix recvfd rpath"));
auto client = TRY(IPC::take_over_accepted_client_from_system_server<LanguageServers::Cpp::ClientConnection>());
auto client = TRY(IPC::take_over_accepted_client_from_system_server<LanguageServers::Cpp::ConnectionFromClient>());
TRY(Core::System::pledge("stdio recvfd rpath"));
TRY(Core::System::unveil("/usr/include", "r"));

View file

@ -7,17 +7,17 @@
#pragma once
#include "ShellComprehensionEngine.h"
#include <DevTools/HackStudio/LanguageServers/ClientConnection.h>
#include <DevTools/HackStudio/LanguageServers/ConnectionFromClient.h>
#include <LibCpp/Parser.h>
namespace LanguageServers::Shell {
class ClientConnection final : public LanguageServers::ClientConnection {
C_OBJECT(ClientConnection);
class ConnectionFromClient final : public LanguageServers::ConnectionFromClient {
C_OBJECT(ConnectionFromClient);
private:
ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
: LanguageServers::ClientConnection(move(socket))
ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> socket)
: LanguageServers::ConnectionFromClient(move(socket))
{
m_autocomplete_engine = make<ShellComprehensionEngine>(m_filedb);
m_autocomplete_engine->set_declarations_of_document_callback = [this](const String& filename, Vector<GUI::AutocompleteProvider::Declaration>&& declarations) {
@ -27,6 +27,6 @@ private:
async_todo_entries_in_document(filename, move(todo_entries));
};
}
virtual ~ClientConnection() override = default;
virtual ~ConnectionFromClient() override = default;
};
}

View file

@ -8,7 +8,7 @@
#include <AK/Assertions.h>
#include <AK/HashTable.h>
#include <LibRegex/Regex.h>
#include <Userland/DevTools/HackStudio/LanguageServers/ClientConnection.h>
#include <Userland/DevTools/HackStudio/LanguageServers/ConnectionFromClient.h>
namespace LanguageServers::Shell {

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ClientConnection.h"
#include "ConnectionFromClient.h"
#include <LibCore/EventLoop.h>
#include <LibCore/LocalServer.h>
#include <LibCore/System.h>
@ -16,7 +16,7 @@ ErrorOr<int> serenity_main(Main::Arguments)
Core::EventLoop event_loop;
TRY(Core::System::pledge("stdio unix rpath recvfd"));
auto client = TRY(IPC::take_over_accepted_client_from_system_server<LanguageServers::Shell::ClientConnection>());
auto client = TRY(IPC::take_over_accepted_client_from_system_server<LanguageServers::Shell::ConnectionFromClient>());
TRY(Core::System::pledge("stdio rpath recvfd"));
TRY(Core::System::unveil("/etc/passwd", "r"));