| 46 | } |
| 47 | |
| 48 | QVector<UnsavedFile> ClangUtils::unsavedFiles() |
| 49 | { |
| 50 | QVector<UnsavedFile> ret; |
| 51 | const auto documents = ICore::self()->documentController()->openDocuments(); |
| 52 | for (auto* document : documents) { |
| 53 | auto textDocument = document->textDocument(); |
| 54 | // TODO: Introduce a cache so we don't have to re-read all the open documents |
| 55 | // which were not changed since the last run |
| 56 | if (!textDocument || !textDocument->url().isLocalFile() || !textDocument->isModified()) { |
| 57 | continue; |
| 58 | } |
| 59 | if (!DocumentFinderHelpers::mimeTypesList().contains(textDocument->mimeType())) { |
| 60 | continue; |
| 61 | } |
| 62 | ret << UnsavedFile(textDocument->url().toLocalFile(), |
| 63 | textDocument->textLines(textDocument->documentRange())); |
| 64 | } |
| 65 | return ret; |
| 66 | } |
| 67 | |
| 68 | KTextEditor::Range ClangUtils::rangeForIncludePathSpec(const QString& line, const KTextEditor::Range& originalRange) |
| 69 | { |
nothing calls this directly
no test coverage detected