2021-03-02 03:10:10 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
2022-02-15 17:28:01 -03:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2021-03-02 03:10:10 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-03-02 03:10:10 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "../AutoCompleteResponse.h"
|
|
|
|
|
#include "FileDB.h"
|
|
|
|
|
#include <AK/HashMap.h>
|
|
|
|
|
#include <AK/LexicalPath.h>
|
2022-05-14 11:09:24 -03:00
|
|
|
#include <LibCodeComprehension/CodeComprehensionEngine.h>
|
2022-02-25 07:18:30 -03:00
|
|
|
#include <LibIPC/ConnectionFromClient.h>
|
2021-03-02 03:10:10 -03:00
|
|
|
|
|
|
|
|
#include <Userland/DevTools/HackStudio/LanguageServers/LanguageClientEndpoint.h>
|
|
|
|
|
#include <Userland/DevTools/HackStudio/LanguageServers/LanguageServerEndpoint.h>
|
|
|
|
|
|
|
|
|
|
namespace LanguageServers {
|
|
|
|
|
|
2022-02-25 07:18:30 -03:00
|
|
|
class ConnectionFromClient : public IPC::ConnectionFromClient<LanguageClientEndpoint, LanguageServerEndpoint> {
|
2021-03-02 03:10:10 -03:00
|
|
|
public:
|
2022-02-25 07:18:30 -03:00
|
|
|
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>);
|
|
|
|
|
~ConnectionFromClient() override = default;
|
2021-03-02 03:10:10 -03:00
|
|
|
|
|
|
|
|
virtual void die() override;
|
|
|
|
|
|
|
|
|
|
protected:
|
2021-05-02 14:54:34 -03:00
|
|
|
virtual void greet(String const&) override;
|
|
|
|
|
virtual void file_opened(String const&, IPC::File const&) override;
|
|
|
|
|
virtual void file_edit_insert_text(String const&, String const&, i32, i32) override;
|
|
|
|
|
virtual void file_edit_remove_text(String const&, i32, i32, i32, i32) override;
|
|
|
|
|
virtual void set_file_content(String const&, String const&) override;
|
2022-05-14 11:09:24 -03:00
|
|
|
virtual void auto_complete_suggestions(CodeComprehension::ProjectLocation const&) override;
|
|
|
|
|
virtual void find_declaration(CodeComprehension::ProjectLocation const&) override;
|
|
|
|
|
virtual void get_parameters_hint(CodeComprehension::ProjectLocation const&) override;
|
2022-02-06 17:28:57 -03:00
|
|
|
virtual void get_tokens_info(String const&) override;
|
2021-03-02 03:10:10 -03:00
|
|
|
|
|
|
|
|
FileDB m_filedb;
|
2022-05-14 11:09:24 -03:00
|
|
|
OwnPtr<CodeComprehension::CodeComprehensionEngine> m_autocomplete_engine;
|
2021-03-02 03:10:10 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|