summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolsplugin.h
Commit message (Collapse)AuthorAgeFilesLines
...
* | CppEditor/CppTools: Move FunctionHelper to CppToolsNikolai Kosjar2013-12-111-0/+3
|/ | | | | | | ...and rename it to FunctionUtils. Change-Id: If076ec01fd82e8ba728764bdeab7e87e8bc1ff3b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: fix auto completion for member of classes accessed by usingPrzemyslaw Gorszkowski2013-11-221-0/+3
| | | | | | | | | | | | | | Example: namespace NS { struct S { int member; void fun(); }; } using NS::S; void S::fun() { mem// ctrl+space } Task-number: QTCREATORBUG-9037 Change-Id: I5a568be1b5c44deb02caa04996167a88a9c5d4d7 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Add basic test for TypeHierarchyBuilderNikolai Kosjar2013-11-121-0/+3
| | | | | Change-Id: I7a82f2b22105d4e096fc0bd69679adacdde2c731 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Limit typedef resolving depthNikolai Kosjar2013-10-181-3/+2
| | | | | | | | | | | This reverts commit 5be56c0 except for its tests. While it fixed the problem described in the bug report, it also introduced regressions. For now, we use a hard limit. Change-Id: I19a85be454e3d7969371707e3eb1c3d42a16ecee Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: fix endless loop during template instantiationPrzemyslaw Gorszkowski2013-10-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the first phase of fixing bug QTCREATORBUG-10320. This change resolves typedefs of template parameters(and resolves problem with endless loop). The next step will be matching appropriate template specialization (this is needed to solve problem with missing code completion). Missing matching: template specialization with the same parameters, e.g.: template <class T1, class T2, class T3> class T { }; template <class T1, class T2> class T<T1, T2, T2> { }; Task-number: QTCREATORBUG-10320 Change-Id: Icb6b539c021b2a67a66db9011a2e627f7d96526b Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: add code-model support for defines-per-editor.Erik Verbruggen2013-10-011-0/+1
| | | | | | | The UI side will come in another commit. Change-Id: I1038a438587fe4cef70408f7f627d08837fc192d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: honor pre-compiled headers in the code-model.Erik Verbruggen2013-10-011-0/+1
| | | | | | | Task-number: QTCREATORBUG-476 Change-Id: I82ed92acdcda551d2c6a9ca221832ac20117a08f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Only parse with appropriate defines for open editors.Erik Verbruggen2013-10-011-0/+1
| | | | | | | | | | | | 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-0/+4
| | | | | | | | | | | | 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>
* Completions: move continuations upper in proposals list.Alexey Semenko2013-09-031-0/+2
| | | | | | | | | | | | | | | | | | Since fuzzy completions are allowed, the lexicographically first proposal is not necessarily most relevant. The patch modifies sorting of proposals so that the exact match and continuations go first, and fuzzy completions follow. Moreover, being a continuation seem to be a more important characteristic of a proposal, than being it a function argument or keyword etc. That's why the check for continuation is placed before the check for order. Task-number: QTCREATORBUG-8737 Task-number: QTCREATORBUG-9236 Change-Id: I89aae9d2ce6bfa59af7c2f75e6f3af00212008ca Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Alexey Zhondin <lexxmark.dev@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Custom directory list for Switch Header/SourceOrgad Shaneh2013-09-031-0/+6
| | | | | | | | | | | | | | | | | | Some projects use separate directories for sources and headers. An example tree: * |-- src |-- foo.cpp |-- include |-- foo.h Allow the user to specify directories for finding out-of-project related header/source files, in addition to current directory Task-number: QTCREATORBUG-8883 Change-Id: I57215c8f2feffcc246d0d161798290861bcfcdd4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: CppPreprocessor: Track also unresolved includesNikolai Kosjar2013-08-221-0/+2
| | | | | Change-Id: Ia36e7e7142dbc030a428369ed04e76e70e8eef0b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/2.8'Oswald Buddenhagen2013-08-211-0/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/cpptools/cppcompletion_test.cpp src/plugins/cpptools/cpptoolsplugin.h src/plugins/projectexplorer/customtoolchain.cpp src/plugins/vcsbase/command.cpp Change-Id: Ie7b3c9e136c0748b41320227c757471259339b48
| * CppTools: Hide "QPrivateSignal" on signal completion (Qt5)Nikolai Kosjar2013-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | See also http://woboq.com/blog/how-qt-signals-slots-work-part2-qt5.html Task-number: QTCREATORBUG-8540 Change-Id: Iccad837d7a0da982e7d7a1eda95ff1828cf1dce6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
* | CppTools: Tests: Introduce basic BuiltinSymbolSearcher testsNikolai Kosjar2013-08-201-0/+3
| | | | | | | | | | Change-Id: I25f11e80747863f797d146980d8ee0e605acb6e5 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppTools: Tests: Add basic tests for locator filtersNikolai Kosjar2013-08-191-0/+4
| | | | | | | | | | Change-Id: Ie71aa8a39f4584a024a4f104841ad8e57947e489 Reviewed-by: David Schulz <david.schulz@digia.com>
* | CppTools: Rework handling of ProjectInfo changesNikolai Kosjar2013-08-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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-0/+1
| | | | | | | | | | | | | | | | | | | | ...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>
* | C++: fix auto completion for template parametersPrzemyslaw Gorszkowski2013-08-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix auto completion for the case when template parameter should be found somewhere of scope of template instantiation declaration. Example: struct A { void foo(); struct B { int b; }; }; template<typename T> struct Template { T* get() { return 0; } T t; }; void A::foo() { Template<B> templ; templ.get()->//no autocompletion templ.t.//no autocompletion } Task-number: QTCREATORBUG-8852 Task-number: QTCREATORBUG-9169 Change-Id: I56b40776e66740f995ae6fc5d69e3c50139a3af2 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge remote-tracking branch 'origin/2.8'Oswald Buddenhagen2013-07-251-3/+4
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/cpptools/cppmodelmanager.cpp Change-Id: I0e69dfad951eb81d8008f5ca05e8fb6999ae2c8a
| * CppTools: Check if project has changed before reparsingNikolai Kosjar2013-07-221-0/+1
| | | | | | | | | | | | | | | | | | 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: Tests: Clean up cppmodelmanager_test.cppNikolai Kosjar2013-07-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First construct a ProjectPart completely, then append it to the ProjectInfo. Doing it the other way around will lead to inconsistencies since some attributes of ProjectInfo are calculated/updated when a ProjectPart is appended. This has no effect on the current tests. * Remove created *.user file when test finishes. * Add comments describing what the tests do. * Rename test methods to some more desribtive names. Change-Id: I5eeed05d0aef19f8094ff488dedcced74f0814f8 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppTools: Garbage collect if the last CppEditor is closedNikolai Kosjar2013-07-171-0/+1
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-9828 Change-Id: Ie0ef9757cedb772702e49542b58d5b589506aa9e Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix local types and membersPrzemyslaw Gorszkowski2013-07-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It fixes code model when we have local type which contains a member of other type, e.g.: struct OtherType { int otherTypeMember; }; void foo() { struct LocalType { int localTypeMember; OtherType ot; }; LocalType lt; lt.ot.//no code completion } Change-Id: I018f492a6c48bfcbba0ef376ef005825e2b13f35 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: code completion for lambda callsPrzemyslaw Gorszkowski2013-07-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | support for lambdas, e.g.: struct S { int bar; }; []() { return new S; } ()->bar; [] { return new S; } ()->bar; []() ->S* { return new S(); } ()->bar; []() throw() { return new S(); } ()->bar; []() throw()->S* { return new S(); } ()->bar; Task-number: QTCREATORBUG-9523 Change-Id: I43fbf6f0ee0bb11411c53c984df75ef33a276466 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Merge remote-tracking branch 'origin/2.8' into HEADEike Ziller2013-07-031-0/+2
|\ \ | |/ | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs Change-Id: I5d2018d3437b99bcdffa92bf1a212f42923c4fad
| * C++: Fix resolving ui_* files in CppPreprocessorNikolai Kosjar2013-07-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The working copy contains the artificial ui_* files and therefore we have to consider it while resolving include files. Task-number: QTCREATORBUG-9683 Change-Id: Icb3387b4cd885b3652bae3f1da465d3e0f633332 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
| * CppTools: Fix snapshot in case another project is openedNikolai Kosjar2013-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | C++: add support for local typesPrzemyslaw Gorszkowski2013-06-181-0/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change addes support for class, enum definition inside blocks({}) or functions, e.g.: void f() { struct S { int bar; }; S s; s.bar; } It fixes: * code completion * highlighting * follow symbol * marking * find usages It fixes also problem with namespace aliases inside blocks or functions. This change can have also impact on performance(there are additional processing) Task-number: QTCREATORBUG-166 (namespace aliases inside function/block) Task-number: QTCREATORBUG-3620 Task-number: QTCREATORBUG-6013 Task-number: QTCREATORBUG-8020 Change-Id: Iaea6c6dfe276f1d7b2279b50bdd2e68e375d31eb Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Fix nextToSurroundingDefinitionsLorenz Haas2013-06-121-0/+2
| | | | | | | | Now it is checked if the adjacent declaration is also defined and one can define the destination file. Change-Id: Ifff59c49fc2ab3e2f36f41df42ae4b7d7ff8dd35 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Handle recursive using/typedef declarationsNikolai Kosjar2013-06-111-0/+5
| | | | | | | | Remember using/typedef declarations we have already looked up and stop if we try it again. Change-Id: I91bf0aef4df18539a47d015f0113543aef1f692a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Handle recursive auto declarationsNikolai Kosjar2013-06-111-0/+2
| | | | | | | | | | | Remember auto declarations we have already looked up and stop if we try it again. Task-number: QTCREATORBUG-9503 Change-Id: I989b11609c98bf197ce916d79c9d452294355053 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/2.7' into 2.8Eike Ziller2013-05-241-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/cpptools/cppcompletion_test.cpp src/plugins/cpptools/cpptoolsplugin.h src/plugins/qbsprojectmanager/qbsbuildstep.cpp src/plugins/qbsprojectmanager/qbscleanstep.cpp src/plugins/qbsprojectmanager/qbsnodes.cpp src/shared/qbs Change-Id: I8fc97ed61c47af2c3d9e5cc2bf81e97661204d4e
| * C++: fix crash during code completion with base template classPrzemyslaw Gorszkowski2013-05-241-0/+1
| | | | | | | | | | | | | | | | | | ResolveExpression has to have a reference of ContextLookup. If not there will be a crash because of deleted instanitated base template class. Task-number: QTCREATORBUG-9329 Change-Id: I7f8c83da0d81ac6311e76d15a897adbc70b08d75 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix typedefed structPrzemyslaw Gorszkowski2013-05-241-2/+11
| | | | | | | | | | | | | | | | | | | | Fixed: * replacing dot with arrow * code completion Task-number: QTCREATORBUG-7373 Change-Id: I6bd3781e91876567ce6f0d4160373438c756c417 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: instantiate template functionsPrzemyslaw Gorszkowski2013-05-241-0/+1
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-9170 Change-Id: I4cac9124558c1d4f0722192246f3fbeea61d3d7d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: Fix 'already seen files' when indexingNikolai Kosjar2013-05-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resetting the environment (after each *.cpp file) did not clear the already seen files (m_included). Because of that the succeeding header files were not parsed correctly - the environments of the mistakenly already seen header files were not merged in. Note that this change slow downs the parsing/indexing of files to its original speed, as it was before the problematic commit (and it is in 2.7): commit 82e347095c4bdb7a6419d28798639e60591e3992 C++: Untangle include file resolving from loading. Task-number: QTCREATORBUG-9205 Change-Id: Iea57b7c59ea04a3c8843fd1291f4c375382958fc Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: added missing cloning of AnonymousNameIdPrzemyslaw Gorszkowski2013-05-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | When instantiate a template with anonymous class/struct/union AnonymousNameId has to be cloned. Task-number: QTCREATORBUG-9227 Change-Id: Iedca5e41589e68a94a35cd4387241052c70c50df Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: fix code completion when 'using' declaration inside functionPrzemyslaw Gorszkowski2013-05-021-0/+2
| | | | | | | | | | | | | | | | Looking for using declaration when lookup a type Task-number: QTCREATORBUG-2668 Change-Id: I11600c5be262840472dd4c9e72334760a35aa4a0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Revert "C++: fix support for typedef of templated typedefs"Nikolai Kosjar2013-04-231-5/+0
| | | | | | | | | | | | | | | | | | | | Still crashes when opening the Qt Creator project, g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 (Ubuntu 12.10). This reverts commit 564c9b2842663062658a0febdcc5787098d871b2. Change-Id: Ief5c0aad463d245f68805f747d277ac298796c3d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: fix support for typedef of templated typedefsPrzemyslaw Gorszkowski2013-04-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fix: * code completion * follow symbols * find usages Task-number: QTCREATORBUG-8375 Change-Id: Ia40273fec3dead76acad4695b852a9e53065d8a7 Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Revert "C++: fix support for typedef of templated typedefs"Erik Verbruggen2013-04-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Infinite recursion in the lookup of: struct common_type { public: typedef typename common_type<typename common_type<_Tp, _Up>::type, V>::type type; }; This reverts commit 9a56ce4e85bec81c521258f44e9076d0bc9cce92 Change-Id: I675fe39018789cd04127d105eb983d2cb7798ca5 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix support for typedef of templated typedefsPrzemyslaw Gorszkowski2013-04-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fix: * code completion * follow symbols * find usages Task-number: QTCREATORBUG-8375 Change-Id: I6f35e809ba15f224c5a6d9b2fcfc18dbfba55411 Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix cloning of templatesPrzemyslaw Gorszkowski2013-04-171-0/+1
| | | | | | | | | | | | | | | | | | Fix instantiation of templates(by cloning original symbols). Assigning of scope for cloned symbol is taken from the symbol which is used to instantiate. Task-number: QTCREATORBUG-9098 Change-Id: I066cc8b5f69333fabdaf2d4466b205baf08bd3f1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: also refresh files not in the project when project changes.Erik Verbruggen2013-04-161-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/2.7'Eike Ziller2013-04-111-0/+1
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/plugins/cpptools/cppchecksymbols.h src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp Change-Id: I887ba071fa637ad44e39bcae581738fa078a6612
| * C++: fixed code completion for namespace aliasesPrzemyslaw Gorszkowski2013-04-101-0/+1
| | | | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-166 Change-Id: I7a19065a57bfb943e5fc4e2bd9bd81988c1175e3 Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppTools: added template function params to completionsSergey Shambir2013-04-101-0/+2
| | | | | | | | | | Change-Id: I67e9685406a0bf9a7cc358ce24f0e862d7938be6 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Clean headers in CppTools.Friedemann Kleint2013-04-101-10/+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>
* | fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | ... 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>