Upgrade plugin to Qt Creator 15

* 🐛 fix: Change plugin configs
* 🐛 fix: Update Button aspect api
* 🐛 fix: Temproary fix for LLMSuggestions
* 🐛 fix: Update github actions
* 🔖 chore: Upgrade version in README
This commit is contained in:
Petr Mironychev
2024-12-03 11:15:35 +01:00
committed by GitHub
parent 76c17f03dd
commit 55e2b24b8d
8 changed files with 144 additions and 142 deletions

View File

@ -213,8 +213,19 @@ void QodeAssistClient::handleCompletions(const GetCompletionRequest::Response &r
}
if (completions.isEmpty())
return;
auto suggestions = Utils::transform(completions, [](const Completion &c) {
auto toTextPos = [](const LanguageServerProtocol::Position pos) {
return Text::Position{pos.line() + 1, pos.character()};
};
Text::Range range{toTextPos(c.range().start()), toTextPos(c.range().end())};
Text::Position pos{toTextPos(c.position())};
return TextSuggestion::Data{range, pos, c.text()};
});
editor->insertSuggestion(
std::make_unique<LLMSuggestion>(completions.first(), editor->document()));
std::make_unique<LLMSuggestion>(suggestions.first(), editor->document()));
}
}