MCPcopy Create free account
hub / github.com/KDE/kdevelop / unsavedFiles

Method unsavedFiles

plugins/clang/util/clangutils.cpp:48–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48QVector<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
68KTextEditor::Range ClangUtils::rangeForIncludePathSpec(const QString& line, const KTextEditor::Range& originalRange)
69{

Callers

nothing calls this directly

Calls 9

mimeTypesListFunction · 0.85
openDocumentsMethod · 0.80
documentControllerMethod · 0.80
isLocalFileMethod · 0.80
toLocalFileMethod · 0.80
textDocumentMethod · 0.45
urlMethod · 0.45
containsMethod · 0.45
mimeTypeMethod · 0.45

Tested by

no test coverage detected