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

Method openedFilesContext

context/ContextManager.cpp:140–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140QString ContextManager::openedFilesContext(const QStringList excludeFiles)
141{
142 QString context = "User files context:\n";
143
144 auto documents = Core::DocumentModel::openedDocuments();
145
146 for (const auto *document : documents) {
147 auto textDocument = qobject_cast<const TextEditor::TextDocument *>(document);
148 if (!textDocument)
149 continue;
150
151 auto filePath = textDocument->filePath().toUrlishString();
152 if (excludeFiles.contains(filePath))
153 continue;
154
155 auto project = ProjectExplorer::ProjectManager::projectForFile(textDocument->filePath());
156 if (project && m_ignoreManager->shouldIgnore(filePath, project)) {
157 LOG_MESSAGE(
158 QString("Ignoring file in context due to .qodeassistignore: %1").arg(filePath));
159 continue;
160 }
161
162 context += QString("File: %1\n").arg(filePath);
163 context += textDocument->plainText();
164
165 context += "\n";
166 }
167
168 return context;
169}
170
171IgnoreManager *ContextManager::ignoreManager() const
172{

Callers 2

handleCompletionMethod · 0.80
prepareContextMethod · 0.80

Calls 2

shouldIgnoreMethod · 0.80
filePathMethod · 0.45

Tested by

no test coverage detected