mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
HackStudio: Do not change the cursor in the LSP autocomplete request
The C++ completion somehow depends on this, so move that behaviour into the C++ language server instead.
This commit is contained in:
parent
9e73b0b696
commit
34039d6639
Notes:
sideshowbarker
2024-07-19 02:03:12 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/34039d66392 Pull-request: https://github.com/SerenityOS/serenity/pull/3675 Reviewed-by: https://github.com/awesomekling
2 changed files with 2 additions and 2 deletions
|
@ -497,7 +497,7 @@ Optional<Editor::AutoCompleteRequestData> Editor::get_autocomplete_request_data(
|
||||||
if (!wrapper().editor().m_language_client)
|
if (!wrapper().editor().m_language_client)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return Editor::AutoCompleteRequestData { { cursor().line(), cursor().column() > 0 ? cursor().column() - 1 : 0 } };
|
return Editor::AutoCompleteRequestData { cursor() };
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::update_autocomplete(const AutoCompleteRequestData& data)
|
void Editor::update_autocomplete(const AutoCompleteRequestData& data)
|
||||||
|
|
|
@ -159,7 +159,7 @@ void ClientConnection::handle(const Messages::LanguageServer::AutoCompleteSugges
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto suggestions = AutoComplete::get_suggestions(document->text(), { (size_t)message.cursor_line(), (size_t)message.cursor_column() });
|
auto suggestions = AutoComplete::get_suggestions(document->text(), { (size_t)message.cursor_line(), (size_t)max(message.cursor_column(), message.cursor_column() - 1) });
|
||||||
post_message(Messages::LanguageClient::AutoCompleteSuggestions(move(suggestions)));
|
post_message(Messages::LanguageClient::AutoCompleteSuggestions(move(suggestions)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue