refactor: Combine bool functions with capabilities to flag

This commit is contained in:
Petr Mironychev
2026-03-30 18:23:32 +02:00
parent 545b8ed000
commit 1c12d6d45c
23 changed files with 59 additions and 120 deletions

View File

@ -369,7 +369,7 @@ TEST_F(DocumentContextReaderTest, testPrepareContext)
EXPECT_EQ(
reader.prepareContext(2, 3, *createSettingsForWholeFile()),
(ContextData{
(QodeAssist::PluginLLMCore::ContextData{
.prefix = "Line 0\nLine 1\nLin",
.suffix = "e 2\nLine 3\nLine 4",
.fileContext = "\n Language: (MIME: text/python) filepath: /path/to/file()\n\n"
@ -377,7 +377,7 @@ TEST_F(DocumentContextReaderTest, testPrepareContext)
EXPECT_EQ(
reader.prepareContext(2, 3, *createSettingsForLines(1, 1)),
(ContextData{
(QodeAssist::PluginLLMCore::ContextData{
.prefix = "Line 1\nLin",
.suffix = "e 2\nLine 3",
.fileContext = "\n Language: (MIME: text/python) filepath: /path/to/file()\n\n"
@ -385,7 +385,7 @@ TEST_F(DocumentContextReaderTest, testPrepareContext)
EXPECT_EQ(
reader.prepareContext(2, 3, *createSettingsForLines(2, 2)),
(ContextData{
(QodeAssist::PluginLLMCore::ContextData{
.prefix = "Line 0\nLine 1\nLin",
.suffix = "e 2\nLine 3\nLine 4",
.fileContext = "\n Language: (MIME: text/python) filepath: /path/to/file()\n\n"

View File

@ -18,7 +18,7 @@
*/
#include <iostream>
#include <llmcore/ContextData.hpp>
#include <pluginllmcore/ContextData.hpp>
#include <QString>
QT_BEGIN_NAMESPACE
@ -61,14 +61,14 @@ std::ostream &operator<<(std::ostream &out, const std::optional<T> &value)
namespace QodeAssist::LLMCore {
inline std::ostream &operator<<(std::ostream &out, const Message &value)
inline std::ostream &operator<<(std::ostream &out, const PluginLLMCore::Message &value)
{
out << "Message{"
<< "role=" << value.role << "content=" << value.content << "}";
return out;
}
inline std::ostream &operator<<(std::ostream &out, const ContextData &value)
inline std::ostream &operator<<(std::ostream &out, const PluginLLMCore::ContextData &value)
{
out << "ContextData{"
<< "\n systemPrompt=" << value.systemPrompt << "\n prefix=" << value.prefix