MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / openedFiles

Method openedFiles

context/ContextManager.cpp:112–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112QList<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
140QString ContextManager::openedFilesContext(const QStringList excludeFiles)
141{

Callers 1

handleCompletionMethod · 0.80

Calls 3

shouldIgnoreMethod · 0.80
appendMethod · 0.80
filePathMethod · 0.45

Tested by

no test coverage detected