summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppmodelmanager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | CppTools: Move GC() call from CppEditorWidget to CppModelManagerNikolai Kosjar2013-07-171-0/+9
| | | | | | | | | | | | | | | | | | There is no need to have that logic in CppEditorWidget. The CppModelManager knows how many editors are open and can therefore call GC() by itself. Change-Id: I2ed4051ad7b8c87615014d73e29291027d49d2ab Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Rename IDocument::fileName --> filePathEike Ziller2013-07-091-1/+1
|/ | | | | | | That is what it actually is, wrt how Qt API calls it. Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: fix potential deadlock when closing an editorErik Verbruggen2013-07-021-3/+8
| | | | | | | | | | | When the editor is closed, the CppEditorSupport waits for the highlighting and semantic info futures to finish. These futures might access the CppEditorSupport through the CppModelManager, causing a deadlock on the m_editorSupportMutex. Change-Id: Ifeb3864ed3bc2666d83607ef50d7bfee8f3d118f Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Fix snapshot in case another project is openedNikolai Kosjar2013-06-281-6/+14
| | | | | | | | | | | When a second project was opened the snapshot was reset. That resulted in all kinds of problems since from then on the code model effectively was not aware of the files of the first project. The regression was introduced by commit a0d6df7b. Change-Id: I1ccc9de68177205b49a4ba8ead2bc8abe4592b32 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* CppTools: Allow to force a "Parsing" notificationNikolai Kosjar2013-06-241-3/+4
| | | | | | | Task-number: QTCREATORBUG-9597 Change-Id: I726a818c7d4af35dcb4863f74b08cd639a189bdd Reviewed-by: Daniel Teske <daniel.teske@digia.com>
* Doc: use standard wording in \brief commandsLeena Miettinen2013-06-201-2/+2
| | | | | | | | | QDoc does some magic with the \class and \namespaces and \brief commands, so the following wording must be used: "The xxx class yyy ..." Change-Id: Id231f30e8464898b776888d5423523de404aae34 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: fix encoding/conversion of built-in macrosErik Verbruggen2013-06-171-1/+1
| | | | | | | | Task-number: QTCREATORBUG-9404 Change-Id: I732b729e64b065b4ac75c547d9370cbc64918a31 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix Q_CREATOR_RUN macro handlingErik Verbruggen2013-06-031-0/+1
| | | | | | | | | Moved it from the handleIfDefDirective to the pre-defined macros, so that #if defined() can also see it. Task-number: QTCREATORBUG-9322 Change-Id: Icbecad5c885dd2374b559969c99631c3ddc73844 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix crash when failing to open non-existing file.Erik Verbruggen2013-05-241-9/+4
| | | | | | Change-Id: Ie7bd3b36139ab7fac1186cefa7222dff7277eb53 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: moved the CppPreprocessor into its own file.Erik Verbruggen2013-04-261-418/+6
| | | | | Change-Id: I399d667a1fccb376fadbd6ab8fbba243e86d8f4b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: model-manager clean-ups.Erik Verbruggen2013-04-261-11/+11
| | | | | Change-Id: I59fdb898e270af0fcc18e79ae922e119504ef10e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++ Detach the CppEditor from code-model internals.Erik Verbruggen2013-04-261-199/+48
| | | | | | | | | - Moved document update handling into CppTools. - Moved semantic info calculation into CppTools. - Moved semantic highlighting into CppTools. Change-Id: I253861bf074a64b1f657f7a4a8e6583871b5285f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Preprocessor: Do not add configurationFileName() to the seen filesNikolai Kosjar2013-04-261-1/+2
| | | | | | | | | | After processing configurationFileName() the first time, it was added to the already seen files (m_included). Thus, on parsing further files, it was ignored and with that all the project defines. Task-number: QTCREATORBUG-9107 Change-Id: Ia4817dfa3b30ed27d142f7f3eeb6f099d0653441 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: do not run GC when exiting.Erik Verbruggen2013-04-221-0/+12
| | | | | | | | | This operation is quite costly if a lot of files are involved, and in case of exiting Creator, it's also useless. Change-Id: I97d178d47a3a2f6b214f7ebc45c871edd26b8286 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: Also cache result of misses in resolveFile()hjk2013-04-161-6/+4
| | | | | Change-Id: Ib501bbe16548b194ff5028a1b3ab74c5f0e3230d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: also refresh files not in the project when project changes.Erik Verbruggen2013-04-161-1/+7
| | | | | | | | | System headers and other file which are not explicitly mentioned in the project must be reparsed when the project changes. Task-number: QTCREATORBUG-9056 Change-Id: I32f1206d241a078a4d9b15fac5813f365a1ba303 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix the quick-exit for already parsed files.Erik Verbruggen2013-04-111-3/+3
| | | | | | | | | | When the preprocessor is asked to process a file which it has already seen before, it can skip it, but it still has to add the file to the list of included files for the current document. Task-number: QTCREATORBUG-9107 Change-Id: I30cac61c1da20da7fe925168ecccb429584e9746 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Clean headers in CppTools.Friedemann Kleint2013-04-101-29/+0
| | | | | | | | Ran script to remove inludes on a trial-and-error basis and manually corrected it. Change-Id: Ic8464ea084ca1ab401e9f4a7d0183b92b4038902 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Untangle include file resolving from loading.Erik Verbruggen2013-04-091-66/+61
| | | | | Change-Id: Iacf8cb12dd623c908538d80ee2595297a9bdde71 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Use namespace CppTools consistentlyTobias Hunger2013-04-081-2/+2
| | | | | | | | | There were quite a few classes using CPlusPlus namespace in the CppTools plugin. Rename them and do some other small namespace related coding style fixups. Change-Id: I093fc1f3fc394fd9923e3f18d5f66522e288f21d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-29/+28
| | | | | | | | | | | ... and adjust INCLUDEPATH accordingly. while i'm at messing with include statements, also re-order the include blocks according to policy and sort them within bigger blocks. Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* CppTools: fixed bugs in change 49602Sergey Shambir2013-03-271-11/+12
| | | | | Change-Id: I14e9bbfea1bca58cdc49212b7ad1d880ab908ec8 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>