| 110 | } |
| 111 | |
| 112 | QList<QPair<QString, QString>> ContextManager::openedFiles(const QStringList excludeFiles) const |
| 113 | { |
| 114 | auto documents = Core::DocumentModel::openedDocuments(); |
| 115 | |
| 116 | QList<QPair<QString, QString>> files; |
| 117 | |
| 118 | for (const auto *document : std::as_const(documents)) { |
| 119 | auto textDocument = qobject_cast<const TextEditor::TextDocument *>(document); |
| 120 | if (!textDocument) |
| 121 | continue; |
| 122 | |
| 123 | auto filePath = textDocument->filePath().toUrlishString(); |
| 124 | |
| 125 | auto project = ProjectExplorer::ProjectManager::projectForFile(textDocument->filePath()); |
| 126 | if (project && m_ignoreManager->shouldIgnore(filePath, project)) { |
| 127 | LOG_MESSAGE( |
| 128 | QString("Ignoring file in context due to .qodeassistignore: %1").arg(filePath)); |
| 129 | continue; |
| 130 | } |
| 131 | |
| 132 | if (!excludeFiles.contains(filePath)) { |
| 133 | files.append({filePath, textDocument->plainText()}); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | return files; |
| 138 | } |
| 139 | |
| 140 | QString ContextManager::openedFilesContext(const QStringList excludeFiles) |
| 141 | { |
no test coverage detected