refactor: Improve textsuggestion working

This commit is contained in:
Petr Mironychev
2025-04-24 01:25:45 +02:00
parent 3e9506ca92
commit 2fe6850a06
3 changed files with 112 additions and 21 deletions

View File

@ -327,7 +327,9 @@ void LLMClientInterface::sendCompletionToClient(
completionItem[LanguageServerProtocol::textKey] = processedCompletion;
QJsonObject range;
range["start"] = position;
range["end"] = position;
QJsonObject end = position;
end["character"] = position["character"].toInt() + processedCompletion.length();
range["end"] = end;
completionItem[LanguageServerProtocol::rangeKey] = range;
completionItem[LanguageServerProtocol::positionKey] = position;
completions.append(completionItem);