summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio/LanguageClient.cpp
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2022-05-14 17:09:24 +0300
committerAndreas Kling <kling@serenityos.org>2022-05-21 18:15:58 +0200
commitb35293d9458bd583f81ca1ec2df59f06e4690bf0 (patch)
tree88e6c1bf229cd54c2ff686c6bd304f06e6d9f8d3 /Userland/DevTools/HackStudio/LanguageClient.cpp
parenta2c34554cd5ff3a17583f885088000b7cf975121 (diff)
downloadserenity-b35293d9458bd583f81ca1ec2df59f06e4690bf0.zip
LibCodeComprehension: Re-organize code comprehension related code
This moves all code comprehension-related code to a new library, LibCodeComprehension. This also moves some types related to code comprehension tasks (such as autocomplete, find declaration) out of LibGUI and into LibCodeComprehension.
Diffstat (limited to 'Userland/DevTools/HackStudio/LanguageClient.cpp')
-rw-r--r--Userland/DevTools/HackStudio/LanguageClient.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Userland/DevTools/HackStudio/LanguageClient.cpp b/Userland/DevTools/HackStudio/LanguageClient.cpp
index 42aa25e3a9..ff43b93a98 100644
--- a/Userland/DevTools/HackStudio/LanguageClient.cpp
+++ b/Userland/DevTools/HackStudio/LanguageClient.cpp
@@ -14,7 +14,7 @@
namespace HackStudio {
-void ConnectionToServer::auto_complete_suggestions(Vector<GUI::AutocompleteProvider::Entry> const& suggestions)
+void ConnectionToServer::auto_complete_suggestions(Vector<CodeComprehension::AutocompleteResultEntry> const& suggestions)
{
if (!m_current_language_client) {
dbgln("Language Server connection has no attached language client");
@@ -23,7 +23,7 @@ void ConnectionToServer::auto_complete_suggestions(Vector<GUI::AutocompleteProvi
m_current_language_client->provide_autocomplete_suggestions(suggestions);
}
-void ConnectionToServer::declaration_location(const GUI::AutocompleteProvider::ProjectLocation& location)
+void ConnectionToServer::declaration_location(CodeComprehension::ProjectLocation const& location)
{
if (!m_current_language_client) {
dbgln("Language Server connection has no attached language client");
@@ -43,7 +43,7 @@ void ConnectionToServer::parameters_hint_result(Vector<String> const& params, in
m_current_language_client->parameters_hint_result(params, static_cast<size_t>(argument_index));
}
-void ConnectionToServer::tokens_info_result(Vector<GUI::AutocompleteProvider::TokenInfo> const& tokens_info)
+void ConnectionToServer::tokens_info_result(Vector<CodeComprehension::TokenInfo> const& tokens_info)
{
if (!m_current_language_client) {
dbgln("Language Server connection has no attached language client");
@@ -93,10 +93,10 @@ void LanguageClient::request_autocomplete(String const& path, size_t cursor_line
if (!m_connection_wrapper.connection())
return;
set_active_client();
- m_connection_wrapper.connection()->async_auto_complete_suggestions(GUI::AutocompleteProvider::ProjectLocation { path, cursor_line, cursor_column });
+ m_connection_wrapper.connection()->async_auto_complete_suggestions(CodeComprehension::ProjectLocation { path, cursor_line, cursor_column });
}
-void LanguageClient::provide_autocomplete_suggestions(Vector<GUI::AutocompleteProvider::Entry> const& suggestions) const
+void LanguageClient::provide_autocomplete_suggestions(Vector<CodeComprehension::AutocompleteResultEntry> const& suggestions) const
{
if (on_autocomplete_suggestions)
on_autocomplete_suggestions(suggestions);
@@ -120,12 +120,12 @@ bool LanguageClient::is_active_client() const
HashMap<String, NonnullOwnPtr<ConnectionToServerWrapper>> ConnectionToServerInstances::s_instance_for_language;
-void ConnectionToServer::declarations_in_document(String const& filename, Vector<GUI::AutocompleteProvider::Declaration> const& declarations)
+void ConnectionToServer::declarations_in_document(String const& filename, Vector<CodeComprehension::Declaration> const& declarations)
{
ProjectDeclarations::the().set_declared_symbols(filename, declarations);
}
-void ConnectionToServer::todo_entries_in_document(String const& filename, Vector<Cpp::Parser::TodoEntry> const& todo_entries)
+void ConnectionToServer::todo_entries_in_document(String const& filename, Vector<CodeComprehension::TodoEntry> const& todo_entries)
{
ToDoEntries::the().set_entries(filename, move(todo_entries));
}
@@ -135,7 +135,7 @@ void LanguageClient::search_declaration(String const& path, size_t line, size_t
if (!m_connection_wrapper.connection())
return;
set_active_client();
- m_connection_wrapper.connection()->async_find_declaration(GUI::AutocompleteProvider::ProjectLocation { path, line, column });
+ m_connection_wrapper.connection()->async_find_declaration(CodeComprehension::ProjectLocation { path, line, column });
}
void LanguageClient::get_parameters_hint(String const& path, size_t line, size_t column)
@@ -143,7 +143,7 @@ void LanguageClient::get_parameters_hint(String const& path, size_t line, size_t
if (!m_connection_wrapper.connection())
return;
set_active_client();
- m_connection_wrapper.connection()->async_get_parameters_hint(GUI::AutocompleteProvider::ProjectLocation { path, line, column });
+ m_connection_wrapper.connection()->async_get_parameters_hint(CodeComprehension::ProjectLocation { path, line, column });
}
void LanguageClient::get_tokens_info(String const& filename)