1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

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.
This commit is contained in:
Itamar 2022-05-14 17:09:24 +03:00 committed by Andreas Kling
parent a2c34554cd
commit b35293d945
65 changed files with 685 additions and 491 deletions

View file

@ -497,7 +497,7 @@ Optional<Editor::AutoCompleteRequestData> Editor::get_autocomplete_request_data(
return Editor::AutoCompleteRequestData { cursor() };
}
void Editor::LanguageServerAidedAutocompleteProvider::provide_completions(Function<void(Vector<Entry>)> callback)
void Editor::LanguageServerAidedAutocompleteProvider::provide_completions(Function<void(Vector<CodeComprehension::AutocompleteResultEntry>)> callback)
{
auto& editor = static_cast<Editor&>(*m_editor).wrapper().editor();
auto data = editor.get_autocomplete_request_data();
@ -655,7 +655,7 @@ void Editor::set_language_client_for(CodeDocument const& document)
m_language_client = get_language_client<LanguageClients::Shell::ConnectionToServer>(project().root_path());
if (m_language_client) {
m_language_client->on_tokens_info_result = [this](Vector<GUI::AutocompleteProvider::TokenInfo> const& tokens_info) {
m_language_client->on_tokens_info_result = [this](Vector<CodeComprehension::TokenInfo> const& tokens_info) {
on_tokens_info_result(tokens_info);
};
}
@ -728,7 +728,7 @@ void Editor::on_token_info_timer_tick()
m_language_client->get_tokens_info(code_document().file_path());
}
void Editor::on_tokens_info_result(Vector<GUI::AutocompleteProvider::TokenInfo> const& tokens_info)
void Editor::on_tokens_info_result(Vector<CodeComprehension::TokenInfo> const& tokens_info)
{
auto highlighter = syntax_highlighter();
if (highlighter && highlighter->is_cpp_semantic_highlighter()) {