summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppmodelmanager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CppTools: Fix compilation with recent gcc 4.9.2Orgad Shaneh2014-09-191-0/+18
| | | | | | | | | | | | | | | | | | See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62224 .obj/release-shared/cppcodemodelinspectordialog.o: In function `CppEditor::Internal::CppCodeModelInspectorDialog::refresh()': cppcodemodelinspectordialog.cpp:(.text+0x79fc): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()' .obj/release-shared/cppcodemodelinspectordialog.o: In function `CppTools::Internal::CppModelManager::definedMacros()': cppcodemodelinspectordialog.cpp:+0x26): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()' .obj/release-shared/cppcodemodelinspectordialog.o: In function `CppTools::Internal::CppModelManager::headerPaths()': cppcodemodelinspectordialog.cpp: +0x26): undefined reference to `CppTools::Internal::CppModelManager::ensureUpdated()' Change-Id: Ie0e01f7628668cbbe11b701a93caef98bb8e335f Reviewed-by: Adam Majer <adamm@zombino.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> (cherry picked from commit c023a1cac182b44baa8645e8955ef03ed0d31fd7) Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: set the objectName of QTimers.Erik Verbruggen2014-08-291-0/+1
| | | | | | | | | This will hopefully help a bit in resolving the crashes that happen in QCoreApplication::notifyInternal. Change-Id: Ib3aa8c1a1f50778bd89938d7c529d8399ccf91ea Task-number: QTCREATORBUG-11262 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix include/framework path handling.Erik Verbruggen2014-07-041-29/+15
| | | | | | | | | | Instead of having two lists of paths, now only one list is used where both include paths and framework paths can be mixed. This reflects the way the compiler is invoked, and retains the (correct) search order. Task-number: QTCREATORBUG-11599 Change-Id: I373953e3e305df5b7a0d10920e12d146584adf9f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Lambda cleanupOrgad Shaneh2014-06-251-1/+1
| | | | | Change-Id: Ia7f1d530e01d4ae3990713e23d672249d9489561 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
* C++: move post-sourceprocessing action into callback.Erik Verbruggen2014-06-181-0/+18
| | | | | Change-Id: Iac6c9fe1ada27ac0d96417e490cc5723e6969541 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: CppHighlightingSupport takes a BaseTextDocumentNikolai Kosjar2014-06-121-8/+6
| | | | | | | | | | ...instead an ITextEditor. The ITextEditor was only used to access the file path and QTextDocument via the BaseTextEditorWidget. Change-Id: Idef2b8162b992fe3718e16e2a046e2ff214846f2 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: CMM::completionAssistProvider takes a mimeTypeNikolai Kosjar2014-06-121-2/+5
| | | | | | | No need to pass more than needed. Change-Id: I047cc44f17342999e0809d022df35ba9a4a8dfb8 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Add dummy macro for __thiscallOrgad Shaneh2014-06-121-0/+1
| | | | | | Change-Id: If2ccfe9ff40539404ed0f40c06c71a73ee661e2d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Remove some duplicate codeNikolai Kosjar2014-06-101-30/+11
| | | | | Change-Id: I83c0bbcf221fd163cd2514a9d23983b82e1f04fd Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Rename CppPreprocessor to CppSourceProcessorNikolai Kosjar2014-06-041-3/+3
| | | | | | | | | | ...since it does quite a bit more than only preprocessing, as the name suggests. We use that class to process source files in general. The output is not a preprocessed source, but a set of CPlusPlus::Documents with symbols. Change-Id: I787d0f22f9f042ddf0c99e8c2f0bdb9aa7001735 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Remove qHash() and operator==() for ProjectPartNikolai Kosjar2014-05-231-40/+0
| | | | | | | These days we rather use ProjectPart::Ptr. Change-Id: I069ad47fe9dd62901e7ac7d43a1850af8cb15f5d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Pass some const variables by referenceOrgad Shaneh2014-05-211-1/+1
| | | | | Change-Id: I3e703c923f6e1a14a89c76f394a070184db0c7bf Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Encode more information in log file of CppCodeModelInspectorNikolai Kosjar2014-03-261-3/+3
| | | | | | | Among others the timestamp and if provided, some extra id. Change-Id: I017c2af197023347c88f2547e7bda8f22b3d00c4 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Use CppCodeModelInspector::DumperNikolai Kosjar2014-03-261-53/+10
| | | | | | | ...if dumping from updateProjectInfo(). Change-Id: I0db5f29605e5cae30e339f246fe2b67e5949fb2d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CodeModel(s): Unify name/values of accessed environment variablesNikolai Kosjar2014-03-261-2/+4
| | | | | | | | | Format: QTC_*=(1|0). Now it's easier to change them in the Run Configuration of Qt Creator. Change-Id: Ifc45cecb89b33a31942b4c3e2d03851a1d72d0bf Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Save some stats by using correct include pathsNikolai Kosjar2014-03-121-0/+1
| | | | | | | ..while initial parsing. Change-Id: I202da3f4f9e445a28e9726352fc005488efe2893 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Fix some typosSergio Ahumada2014-03-051-1/+1
| | | | | | Change-Id: I3be73c2a4d256a0d28e863fd2517a4d7442b34d8 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* C++: introduce a project config file field in the projectPart.Erik Verbruggen2014-02-271-1/+6
| | | | | | | | | | | This field is used by the generic project manager which passes the ".config" file in it. The advantage is that both the SnapshotUpdater and the clang code model do not need to do anything smart, but can pass it directly to the preprocessor. Task-number: QTCREATORBUG-11390 Change-Id: I44fc7b20afd28fb59608412f2cce86af6f7e7d6b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* qml: moving most of ModelManager logic to ModelManageInterfaceFawzi Mohamed2014-02-191-2/+3
| | | | | | | | | | | | | | Currently ModelManager contains lot logic, but as it sits in QmlJSTools it is not possible to use it in standalone tests. Moving most of the logic to ModelManagerInterface (and cleanup) to allow better testing, and refactoring. This introduces a dependency of the qmljs lib on the cplusplus lib Also a (small) part of the CppTool::ModelManagerInterface has been moved to CPlusPlus::CppModelManagerBase to remove the dependency on CppTools to gather the Qml types exposed from C++. Change-Id: Icad7fe96dfd0f1a2b1058d82bd98c77c40aa5e9d Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* Merge remote-tracking branch 'origin/3.0'Eike Ziller2014-01-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: share/qtcreator/debugger/dumper.cpp share/qtcreator/debugger/dumper_p.h share/qtcreator/debugger/test/main.cpp src/plugins/debugger/gdb/classicgdbengine.cpp src/plugins/debugger/gdb/pythongdbengine.cpp src/plugins/debugger/lldblib/guest/lldbengineguest.cpp src/plugins/debugger/lldblib/guest/lldbengineguest.h src/plugins/debugger/lldblib/guest/main.cpp src/plugins/debugger/lldblib/ipcengineguest.cpp src/plugins/debugger/lldblib/ipcengineguest.h src/plugins/debugger/lldblib/ipcenginehost.cpp src/plugins/debugger/lldblib/ipcenginehost.h src/plugins/debugger/lldblib/lldbenginehost.cpp src/plugins/debugger/lldblib/lldboptionspage.cpp src/plugins/qbsprojectmanager/qbsstep.cpp src/plugins/qbsprojectmanager/qbsstep.h src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp src/plugins/qnx/blackberrycheckdevmodestep.cpp src/plugins/qtsupport/debugginghelper.cpp Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
| * Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | | | | | | | Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | CppEditor/CppTools: Avoid triggering garbage collector on editor close in testsNikolai Kosjar2014-01-071-1/+8
| | | | | | | | | | | | | | | | | | | | | | Closing an editor might trigger a timer which leads to the invocation of the garbage collector. This is unfavourable for the plugin tests since a test function closing an editor might influence a subsequent test function (e.g. files get removed from the global snapshot although they were added shortly before). Change-Id: Ia80c11f99e2437fe145dc2d983b21962539b5181 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Merge remote-tracking branch 'origin/3.0'Eike Ziller2013-12-181-2/+9
|\ \ | |/ | | | | | | | | | | | | Conflicts: share/qtcreator/debugger/stdtypes.py src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp Change-Id: I5d86746d58960e41e01e725ccb2a6c00890f0dfd
| * CppEditor: Use the project part chosen with CppPreProcessorDialogNikolai Kosjar2013-12-161-2/+9
| | | | | | | | | | | | | | | | | | ...otherwise the CppPreProcessorDialog is only semi-useful. Change-Id: I6b80967b05e7c9a51cd78ae064a3d78170948e32 Reviewed-by: David Schulz <david.schulz@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | C++: split defines into project-defined and toolchain-defined.Erik Verbruggen2013-12-101-12/+26
|/ | | | | | | | So we can ignore possibly problematic toolchain-defines, while can still unconditionally apply project-defines. Change-Id: I7cb96f35a963d080011fe888ef71bfc098dd33ef Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Add revisions to AbstractEditorSupportNikolai Kosjar2013-11-251-1/+1
| | | | | | | | | | | | | | So far revisions for AbstractEditorSupport were not needed because until recently we only had a single snapshot ("global snapshot"). Now, since editor snapshots are introduced, we need to make sure to update the corresponding documents in these snapshots, too. To do this efficiently, a revision is introduced for AbstractEditorSupport. Task-number: QTCREATORBUG-10894 Change-Id: Ibad1dbbafb7c721d1328959c1e903345fe465326 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Designer/CppTools: Fix flaky test_gotoslot_withoutProjectNikolai Kosjar2013-11-141-1/+1
| | | | | | | The document was not always updated in time. Change-Id: Iac89985d39a8784e3cbf63dfd42b1c5150775068 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* C++: Release more documents.Erik Verbruggen2013-11-121-0/+5
| | | | | | | | | | | | | | | | | | | | - fix memory leak in find-usages - do not retain snapshot in search history - when an editor is invisible for more than 2 minutes, release the backing snapshot Retaining snapshots will retain their documents, and if done for too long, the memory consumption might grow. This is especially the case when switching to a different kit (Qt version): in that case, the new versions of headers will be indexed, while the old ones stay around. Task-number: QTCREATORBUG-5583 Task-number: QTCREATORBUG-7645 Task-number: QTCREATORBUG-9842 Change-Id: I045eda1565e0a3fa702baeffaab9c12662f90289 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Rename "[Mm]ethod(s)" to "[Ff]unction(s)"Nikolai Kosjar2013-10-101-1/+1
| | | | | | | | | | | Only methods as programming functions are affected. Besides renaming some actions like "Switch Between Function Declaration/Definition" this mostly touches (api) code comments. This is a follow-up patch to commit 872bfb7. Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92 Reviewed-by: hjk <hjk121@nokiamail.com>
* CppTools: Tests: Fix crash in test_modelmanager_gc_if_last_cppeditor_closedNikolai Kosjar2013-10-091-8/+16
| | | | | | | | | | | The project that was referenced at cppeditor.cpp:711 was already deleted. CppModelManager::m_fileToProjectParts contained outdated information. Now it is updated if a project is closed. Exposed by commit d411c07. Change-Id: I6fee93a02c72a045dd44a05723ab39a1eeec616e Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Only parse with appropriate defines for open editors.Erik Verbruggen2013-10-011-10/+14
| | | | | | | | | | | | If two files from different (sub-)projects include the same header file, and the defined macros differ for both files, the header file will be parsed with only the appropriate macros for the including file. Task-number: QTCREATORBUG-9802 Task-number: QTCREATORBUG-1249 Change-Id: I560490afa287b3bb1e863bce1bb4f57af36ad56e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: add code-model settings to choose one by mime-type.Erik Verbruggen2013-09-131-3/+11
| | | | | | | | | | | | The model-manager now supports multiple code models for semantic highlighting and code completion, and will choose one based on the mime-type of the editor. The settings page is currently disabled. It will get enabled when a second plug-in lands that has a ModelManagerSupport class. Change-Id: I10023f52322ed6860397da15dba1c231e80e6517 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: change working-copy to work on UTF-8 encoded QByteArrays.Erik Verbruggen2013-09-111-3/+3
| | | | | | | | | | | | These not only take less space than UTF-16 encoded QStrings, but due to the caching in the CppEditorSupport also take less time to build. This patch also fixes a number of possible encoding issues, where files and constant strings were (falsely) assumed to be UTF-8. Change-Id: Ib6f91c9a94ebed5b5dfbd4eb2998825c62c72784 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* C++: unify highlighting/code-completion support "factories".Erik Verbruggen2013-09-101-27/+20
| | | | | | | | | | | Both semantic highlighting and code-completion go hand-in-hand, so now the ModelManagerSupport class acts as a "factory" for the model manager. Depending on the mime-type of the document in the editor, the model manager will return the appropriate highlighter or code-completion engine. If none is registered, the built-in fall-back is used. Change-Id: I3e5dbb0e3b58e077dd5eda9aecb2ce5d448ac0b8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: add fallback project part queryingErik Verbruggen2013-09-101-1/+16
| | | | | | | | | | When a file is not part of any other project part, this project part can be used to get at least some compiler flags, defines, etc. to use. This can happen when either a file outside a project is opened, or when the project description is incomplete. Change-Id: I5d595fae7195e8b61dbad14368b6cae9eb15c21b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: clean-up CppCompletionAssist.Erik Verbruggen2013-09-091-16/+3
| | | | | | | | | | This is step 1 of 2 for merging the various provider factories into a single class. Merging has the advantage that selecting based on editor (content) mime-type only has to select one class, instead of re-doing the selection for each class separately. Change-Id: I11f815151bd4769ae6028b636793d6a80d02e202 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* TextEditor: get CompletionAssistProvider from editor.Erik Verbruggen2013-09-091-0/+7
| | | | | | | | | | And not from the global object pool. This way, the editors that have different highlighters for various language dialects, or editors that support multiple languages in a single editor, can decide themselves on what CompletionAssistProvider to provide. Change-Id: Ieebc4a8e7b3de6470fdb8103035aa3b8b2ba6598 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* SessionManager: Apply 'static' patternhjk2013-09-051-11/+5
| | | | | Change-Id: I370f72fcf7a24216ee189979ce6b5c8bfc5f4140 Reviewed-by: David Schulz <david.schulz@digia.com>
* ProjectManager: Use Core::Id for progress typeshjk2013-09-041-2/+1
| | | | | Change-Id: I72993fda50ad70ad2d7c2f449923ac6e34b9e737 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* Core: Static pattern for ProgressManager, clean up all usershjk2013-09-021-2/+2
| | | | | Change-Id: I4af8793ca69a3af9e99baeb7c31dad3864266f91 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* C++: optionally let the highlighter handle ifdefed-out blocks.Erik Verbruggen2013-08-191-0/+18
| | | | | Change-Id: I38cc0e55348cac0245d2ab8f3e39c68de76e3e6d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Rework handling of ProjectInfo changesNikolai Kosjar2013-08-131-26/+159
| | | | | | | | | | | | | | | | | (a) The code model manager figures out by itself which files were added or removed from the project. If this was done successfully, check also the timestamp of the common files and reindex if necessary. (b) A full reindexing is only triggered if the project configuration changes (defines, includes, framework paths). (c) If project files were removed, the garbage collector is called. Task-number: QTCREATORBUG-9730 Change-Id: Ib855614b070880576233a3525813617c967a72f3 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* CppTools: Do not garbage collect files in the working copyNikolai Kosjar2013-08-081-2/+21
| | | | | | | | | | ...except the configuration file if no projects are open. For this case there is no need to keep the configuration file around. Task-number: QTCREATORBUG-9829 Change-Id: I51b01b30c17cbc1ced491ef2c47c338dae6ed983 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Do not call GC() more than necessaryNikolai Kosjar2013-08-081-3/+21
| | | | | | | | | | | | | | | | | Currently GC() is invoked if - 5 CppEditors were closed or the last CppEditor was closed - a project is about to be removed - a session is about to be unloaded Thus, for the following use cases, too much GC() calls (can) happen: - File > Close All - Close All Projects and Editors - Changing the session Fixed by introducing a timer. Change-Id: I9c984d9de735fc8c6ee77a518e9fb5b63dba5881 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Introduce Project::projectFilePath()Tobias Hunger2013-08-011-1/+1
| | | | | | | Use it instead of retrieving this information from the document. Change-Id: I809fcb2daf59021cf503c371a5d40d75d7448796 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* CppTools: Clean up CppModelManager(Interface)Nikolai Kosjar2013-07-311-121/+123
| | | | | | | | | | | * Const correctness * Better variable names * Sort order of includes and forward declarations * Comment fixes * Cosmetic/Whitespace changes Change-Id: Ieb137266ac7eddedb00c37f8b2cc8677d67e4bdd Reviewed-by: David Schulz <david.schulz@digia.com>
* Merge remote-tracking branch 'origin/2.8'Oswald Buddenhagen2013-07-251-2/+11
|\ | | | | | | | | | | | | Conflicts: src/plugins/cpptools/cppmodelmanager.cpp Change-Id: I0e69dfad951eb81d8008f5ca05e8fb6999ae2c8a
| * CppTools: Check if project has changed before reparsingNikolai Kosjar2013-07-221-2/+11
| | | | | | | | | | | | | | | | | | This introduces an API change for the project managers. Those are not expected to call updateSourceFiles() anymore. Task-number: QTCREATORBUG-9581 Change-Id: I77befd29fb851c9acf87204d571da00183c9cd05 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppTools: Fix "! condition" coding styleNikolai Kosjar2013-07-251-4/+4
| | | | | | | | | | | | Change-Id: Ic7e634e4249fb64edbc2daceb65ec8e9b5f0f8b9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
* | CppTools: Garbage collect if the last CppEditor is closedNikolai Kosjar2013-07-171-2/+3
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-9828 Change-Id: Ie0ef9757cedb772702e49542b58d5b589506aa9e Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>