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:
AnotherTest 2020-10-04 11:16:13 +03:30 committed by Andreas Kling
parent 9e73b0b696
commit 34039d6639
Notes: sideshowbarker 2024-07-19 02:03:12 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -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)

View file

@ -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)));
} }