mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-06-04 01:28:58 -04:00
Exclude current file cache from request
This commit is contained in:
parent
cd1a9e16e0
commit
2fb876ff00
@ -278,7 +278,7 @@ ContextData LLMClientInterface::prepareContext(const QJsonObject &request,
|
|||||||
|
|
||||||
DocumentContextReader reader(widget->textDocument());
|
DocumentContextReader reader(widget->textDocument());
|
||||||
|
|
||||||
QString recentChanges = ChangesManager::instance().getRecentChangesContext();
|
QString recentChanges = ChangesManager::instance().getRecentChangesContext(textDocument);
|
||||||
|
|
||||||
QString contextBefore = сontextBefore(widget, lineNumber, cursorPosition);
|
QString contextBefore = сontextBefore(widget, lineNumber, cursorPosition);
|
||||||
QString contextAfter = сontextAfter(widget, lineNumber, cursorPosition);
|
QString contextAfter = сontextAfter(widget, lineNumber, cursorPosition);
|
||||||
|
@ -72,12 +72,14 @@ void ChangesManager::addChange(TextEditor::TextDocument *document,
|
|||||||
logMessage(QString("ChangesManager: Document queue size %1").arg(documentQueue.size()));
|
logMessage(QString("ChangesManager: Document queue size %1").arg(documentQueue.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ChangesManager::getRecentChangesContext() const
|
QString ChangesManager::getRecentChangesContext(const TextEditor::TextDocument *currentDocument) const
|
||||||
{
|
{
|
||||||
QString context;
|
QString context;
|
||||||
for (const auto &documentChanges : m_documentChanges) {
|
for (auto it = m_documentChanges.constBegin(); it != m_documentChanges.constEnd(); ++it) {
|
||||||
for (const auto &change : documentChanges) {
|
if (it.key() != currentDocument) {
|
||||||
context += change.lineContent + "\n";
|
for (const auto &change : it.value()) {
|
||||||
|
context += change.lineContent + "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
int position,
|
int position,
|
||||||
int charsRemoved,
|
int charsRemoved,
|
||||||
int charsAdded);
|
int charsAdded);
|
||||||
QString getRecentChangesContext() const;
|
QString getRecentChangesContext(const TextEditor::TextDocument *currentDocument) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ChangesManager();
|
ChangesManager();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user