Changeset View
Changeset View
Standalone View
Standalone View
languages/clang/clangparsejob.cpp
Context not available. | |||||
52 | #include "duchain/clangparsingenvironmentfile.h" | 52 | #include "duchain/clangparsingenvironmentfile.h" | ||
---|---|---|---|---|---|
53 | #include "util/clangdebug.h" | 53 | #include "util/clangdebug.h" | ||
54 | #include "util/clangtypes.h" | 54 | #include "util/clangtypes.h" | ||
55 | #include "util/clangutils.h" | ||||
55 | 56 | | |||
56 | #include "clangsupport.h" | 57 | #include "clangsupport.h" | ||
57 | #include "duchain/documentfinderhelpers.h" | 58 | #include "duchain/documentfinderhelpers.h" | ||
Context not available. | |||||
188 | } | 189 | } | ||
189 | m_environment.setProjectPaths(projectPaths); | 190 | m_environment.setProjectPaths(projectPaths); | ||
190 | 191 | | |||
192 | m_unsavedFiles = ClangUtils::unsavedFiles(); | ||||
193 | | ||||
191 | foreach(auto document, ICore::self()->documentController()->openDocuments()) { | 194 | foreach(auto document, ICore::self()->documentController()->openDocuments()) { | ||
192 | auto textDocument = document->textDocument(); | 195 | auto textDocument = document->textDocument(); | ||
193 | // TODO: Introduce a cache so we don't have to re-read all the open documents | 196 | if ( !textDocument ) { | ||
194 | // which were not changed since the last run | | |||
195 | if (!textDocument || !textDocument->url().isLocalFile() | | |||
196 | || !DocumentFinderHelpers::mimeTypesList().contains(textDocument->mimeType())) | | |||
197 | { | | |||
198 | continue; | 197 | continue; | ||
199 | } | 198 | } | ||
200 | m_unsavedFiles << UnsavedFile(textDocument->url().toLocalFile(), textDocument->textLines(textDocument->documentRange())); | | |||
201 | const IndexedString indexedUrl(textDocument->url()); | 199 | const IndexedString indexedUrl(textDocument->url()); | ||
202 | m_unsavedRevisions.insert(indexedUrl, ModificationRevision::revisionForFile(indexedUrl)); | | |||
203 | if (indexedUrl == tuUrl) { | 200 | if (indexedUrl == tuUrl) { | ||
204 | m_tuDocumentIsUnsaved = true; | 201 | m_tuDocumentIsUnsaved = true; | ||
205 | } | 202 | } | ||
203 | m_unsavedRevisions.insert(indexedUrl, ModificationRevision::revisionForFile(indexedUrl)); | ||||
206 | } | 204 | } | ||
207 | 205 | | |||
208 | if (auto tracker = trackerForUrl(url)) { | 206 | if (auto tracker = trackerForUrl(url)) { | ||
Context not available. |