mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-18 13:04:28 -04:00
refactor: Make DocumentContextReader usable outside Qt Creator context (#89)
This makes it possible to write simple unit tests for it without running full Qt Creator. Not coupling DocumentContextReader to TextEditor::TextDocument unnecessarily is also a better design in general.
This commit is contained in:
committed by
GitHub
parent
29a3939c64
commit
bcf7b6c226
@ -265,7 +265,8 @@ LLMCore::ContextData LLMClientInterface::prepareContext(
|
||||
int cursorPosition = position["character"].toInt();
|
||||
int lineNumber = position["line"].toInt();
|
||||
|
||||
Context::DocumentContextReader reader(textDocument);
|
||||
Context::DocumentContextReader reader(
|
||||
textDocument->document(), textDocument->mimeType(), textDocument->filePath().toString());
|
||||
return reader.prepareContext(lineNumber, cursorPosition);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user