mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-07-21 02:31:05 -04:00
refactor: Restructure project into sources/tests layout and dissolve PluginLLMCore
This commit is contained in:
30
sources/context/DocumentReaderQtCreator.hpp
Normal file
30
sources/context/DocumentReaderQtCreator.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2025 Povilas Kanapickas
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IDocumentReader.hpp"
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
namespace QodeAssist::Context {
|
||||
|
||||
class DocumentReaderQtCreator : public IDocumentReader
|
||||
{
|
||||
public:
|
||||
DocumentInfo readDocument(const QString &path) const override
|
||||
{
|
||||
auto *textDocument = TextEditor::TextDocument::textDocumentForFilePath(
|
||||
Utils::FilePath::fromString(path));
|
||||
if (!textDocument) {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
.document = textDocument->document(),
|
||||
.mimeType = textDocument->mimeType(),
|
||||
.filePath = path};
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Context
|
||||
Reference in New Issue
Block a user