refactor: Extract document reading to separate class (#127)

This decouples LLMClientInterface from Qt Creator text editor
implementation and allows to write tests
This commit is contained in:
Povilas Kanapickas
2025-03-10 18:42:40 +02:00
committed by GitHub
parent a218064a4f
commit 719065ebfc
6 changed files with 99 additions and 7 deletions

View File

@ -22,6 +22,7 @@
#include <languageclient/languageclientinterface.h>
#include <texteditor/texteditor.h>
#include <context/IDocumentReader.hpp>
#include <context/ProgrammingLanguage.hpp>
#include <llmcore/ContextData.hpp>
#include <llmcore/IPromptProvider.hpp>
@ -47,6 +48,7 @@ public:
LLMCore::IProviderRegistry &providerRegistry,
LLMCore::IPromptProvider *promptProvider,
LLMCore::RequestHandlerBase &requestHandler,
Context::IDocumentReader &documentReader,
IRequestPerformanceLogger &performanceLogger);
Utils::FilePath serverDeviceTemplate() const override;
@ -77,6 +79,7 @@ private:
LLMCore::IPromptProvider *m_promptProvider = nullptr;
LLMCore::IProviderRegistry &m_providerRegistry;
LLMCore::RequestHandlerBase &m_requestHandler;
Context::IDocumentReader &m_documentReader;
IRequestPerformanceLogger &m_performanceLogger;
QElapsedTimer m_completionTimer;
};