CppTools: Auto-include pre-compiled headers

So far the pre-compiled headers were processed (thus defines from those
headers were visible), but the actual includes for the documents were
not added, which is necessary for lookup/completion.

Note that this will be only done if pre-compiled headers are not ignored
(Options > C++ > Code Model > [] Ignore pre-compiled headers).

Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-07-16 11:25:15 +02:00
parent 4e9d3b044e
commit 6a9ae7e25f
11 changed files with 51 additions and 20 deletions

View File

@@ -177,7 +177,8 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy)
}
if (!m_editorDefines.isEmpty())
sourceProcessor.run(editorDefinesFileName);
sourceProcessor.run(m_fileInEditor);
sourceProcessor.run(m_fileInEditor, m_usePrecompiledHeaders ? m_precompiledHeaders
: QStringList());
m_snapshot = sourceProcessor.snapshot();
Snapshot newSnapshot = m_snapshot.simplified(document());