mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:47:34 +00:00
LanguageServers: Remove ClientConnection dependency
We now no longer need to provide a ClientConnection object to construct AutoCompleteEngine.
This commit is contained in:
parent
687efe6dd6
commit
c49cf23a86
12 changed files with 24 additions and 29 deletions
|
@ -19,8 +19,10 @@ public:
|
|||
ClientConnection(NonnullRefPtr<Core::LocalSocket> socket, int client_id)
|
||||
: LanguageServers::ClientConnection(move(socket), client_id)
|
||||
{
|
||||
m_autocomplete_engine = make<ParserAutoComplete>(*this, m_filedb);
|
||||
m_autocomplete_engine->set_declarations_of_document_callback = &ClientConnection::set_declarations_of_document_callback;
|
||||
m_autocomplete_engine = make<ParserAutoComplete>(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;
|
||||
|
@ -30,9 +32,9 @@ private:
|
|||
{
|
||||
dbgln_if(CPP_LANGUAGE_SERVER_DEBUG, "SetAutoCompleteMode: {}", mode);
|
||||
if (mode == "Parser")
|
||||
m_autocomplete_engine = make<ParserAutoComplete>(*this, m_filedb);
|
||||
m_autocomplete_engine = make<ParserAutoComplete>(m_filedb);
|
||||
else
|
||||
m_autocomplete_engine = make<LexerAutoComplete>(*this, m_filedb);
|
||||
m_autocomplete_engine = make<LexerAutoComplete>(m_filedb);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
namespace LanguageServers::Cpp {
|
||||
|
||||
LexerAutoComplete::LexerAutoComplete(ClientConnection& connection, const FileDB& filedb)
|
||||
: AutoCompleteEngine(connection, filedb)
|
||||
LexerAutoComplete::LexerAutoComplete(const FileDB& filedb)
|
||||
: AutoCompleteEngine(filedb)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ using namespace ::Cpp;
|
|||
|
||||
class LexerAutoComplete : public AutoCompleteEngine {
|
||||
public:
|
||||
LexerAutoComplete(ClientConnection&, const FileDB& filedb);
|
||||
LexerAutoComplete(const FileDB& filedb);
|
||||
|
||||
virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position) override;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
namespace LanguageServers::Cpp {
|
||||
|
||||
ParserAutoComplete::ParserAutoComplete(ClientConnection& connection, const FileDB& filedb)
|
||||
: AutoCompleteEngine(connection, filedb, true)
|
||||
ParserAutoComplete::ParserAutoComplete(const FileDB& filedb)
|
||||
: AutoCompleteEngine(filedb, true)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ using namespace ::Cpp;
|
|||
|
||||
class ParserAutoComplete : public AutoCompleteEngine {
|
||||
public:
|
||||
ParserAutoComplete(ClientConnection&, const FileDB& filedb);
|
||||
ParserAutoComplete(const FileDB& filedb);
|
||||
|
||||
virtual Vector<GUI::AutocompleteProvider::Entry> get_suggestions(const String& file, const GUI::TextPosition& autocomplete_position) override;
|
||||
virtual void on_edit(const String& file) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue