mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-06-14 02:09:22 -04:00
refactor: IProjectScanner port; ContextManager QtC-free
This commit is contained in:
@@ -4,18 +4,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
#include "ContentFile.hpp"
|
||||
#include "IContextManager.hpp"
|
||||
#include "IgnoreManager.hpp"
|
||||
#include "IProjectScanner.hpp"
|
||||
#include "ProgrammingLanguage.hpp"
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Project;
|
||||
}
|
||||
|
||||
namespace QodeAssist::Context {
|
||||
|
||||
class ContextManager : public QObject, public IContextManager
|
||||
@@ -24,22 +22,22 @@ class ContextManager : public QObject, public IContextManager
|
||||
|
||||
public:
|
||||
explicit ContextManager(QObject *parent = nullptr);
|
||||
~ContextManager() override = default;
|
||||
ContextManager(std::unique_ptr<IProjectScanner> scanner, QObject *parent = nullptr);
|
||||
~ContextManager() override;
|
||||
|
||||
QString readFile(const QString &filePath) const override;
|
||||
QList<ContentFile> getContentFiles(const QStringList &filePaths) const override;
|
||||
QStringList getProjectSourceFiles(ProjectExplorer::Project *project) const override;
|
||||
ContentFile createContentFile(const QString &filePath) const override;
|
||||
|
||||
ProgrammingLanguage getDocumentLanguage(const DocumentInfo &documentInfo) const override;
|
||||
bool isSpecifyCompletion(const DocumentInfo &documentInfo) const override;
|
||||
QList<QPair<QString, QString>> openedFiles(const QStringList excludeFiles = QStringList{}) const;
|
||||
QString openedFilesContext(const QStringList excludeFiles = QStringList{});
|
||||
|
||||
IgnoreManager *ignoreManager() const;
|
||||
QString openedFilesContext(const QStringList &excludeFiles = QStringList{}) const;
|
||||
|
||||
bool shouldIgnore(const QString &filePath) const;
|
||||
|
||||
private:
|
||||
IgnoreManager *m_ignoreManager;
|
||||
std::unique_ptr<IProjectScanner> m_scanner;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::Context
|
||||
|
||||
Reference in New Issue
Block a user