Add basic cache manager

This commit is contained in:
Petr Mironychev
2024-09-11 01:25:00 +02:00
parent f07610df5c
commit cd1a9e16e0
5 changed files with 163 additions and 6 deletions

View File

@ -31,6 +31,7 @@
#include "LLMClientInterface.hpp"
#include "LLMSuggestion.hpp"
#include "core/ChangesManager.h"
#include "settings/GeneralSettings.hpp"
using namespace LanguageServerProtocol;
@ -83,6 +84,9 @@ void QodeAssistClient::openDocument(TextEditor::TextDocument *document)
auto textEditor = BaseTextEditor::currentTextEditor();
if (!textEditor || textEditor->document() != document)
return;
ChangesManager::instance().addChange(document, position, charsRemoved, charsAdded);
TextEditorWidget *widget = textEditor->editorWidget();
if (widget->isReadOnly() || widget->multiTextCursor().hasMultipleCursors())
return;