summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* C++: Fix completion for doxygen tags IINikolai Kosjar2016-03-311-0/+7
| | | | | | | | | | | | | | | | | For assist processors that run in a worker thread, the QTextDocument is recreated with AssistInterface::prepareForAsyncUse and AssistInterface::recreateTextDocument. Since some assist processors (C++, QmlJS) rely on the user states of the QTextBlocks, these must be recreated, too. In the referenced bug report the lexer state (user state) of the previous QTextBlock was invalid and thus the "Doxygen tag completion" failed. Task-number: QTCREATORBUG-9373 Change-Id: If668e98aa6f9fe9fc107c7476fc831e92a0d7572 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* C++: Fix completion for doxygen tags INikolai Kosjar2016-03-311-0/+35
| | | | | | | | | | | | | | | There are three cases that must be handled: 1. Completion in C++ style comment 2. Completion in first line of a C style comment 3. Completion in non-first line of a C style comment This change fixes case 1 + 2. Case 3 will be addressed in a follow-up change, same goes for the duplication. Task-number: QTCREATORBUG-15143 Change-Id: I449711f965ddcbbe6158870a8a5ae33218e0d238 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CppTools: Move ProjectPart in its own header fileMarco Bubke2016-01-131-1/+1
| | | | | | | | Also extracting inline HeaderPath class and change projects list in vector because the size is larger than a pointer. Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Revert lookup to 3.4.2Nikolai Kosjar2015-11-191-503/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...which was least buggy. The bugs fixed by the changes we revert here (highlighting/completion for code involving templates) were minor compared to ones we currently have. Those bugs will be addressed by the clang code model anyway. Relevant commits were collected via: $ cd ${QTC}/src/libs/cplusplus $ git log \ --no-merges \ --format=oneline \ v3.4.2..HEAD \ -- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \ ../../plugins/cpptools/cppcompletion_test.cpp From this list the following were skipped due to irrelevance: 88c5b47e535d91f3db99882d5b50b263b46f223c # CppTools: Minor cleanup in completion tests e5255a1f5cac284c4f0d4a85203878c84da86e85 # CppTools: Add a test for ObjC not replacing dot with arrow 5b12c8d63a30e281274cdc267efabead2c736bd8 # CppTools: Support ObjC in member access operator tests 9fef4fb9ca4e65e20ff13b98bcf15e3c6232fdfb # CPlusPlus: Fix warnings about overriding visit(...) methods There were only minor conflicts while reverting those. This changes touches so many files because there were quite some cleanups and renames after the 3.4.2 release. Task-number: QTCREATORBUG-14889 Task-number: QTCREATORBUG-15211 Task-number: QTCREATORBUG-15213 Task-number: QTCREATORBUG-15257 Task-number: QTCREATORBUG-15264 Task-number: QTCREATORBUG-15291 Task-number: QTCREATORBUG-15329 Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* CppTools: Minor cleanup in completion testsOrgad Shaneh2015-10-201-3/+3
| | | | | | | | * Remove superfluous dot from test file name * Reuse an existing member Change-Id: I735dee09ae7ceef4509a4bda87118baaf4d11b01 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Comment out a flaky testNikolai Kosjar2015-09-281-16/+15
| | | | | | | | | | | | | | | | | The test relied on logic that was reverted with change 915f68deac95bf17bd97d1a2644264afb0b86f0b. LookupScopePrivate::findSpecialization() gets a "TemplateNameIdTable &specializations" with a non-deterministic order. Without the extra logic, the very first entry will be chosen as the found specialization. The non-deterministic order comes from the TemplateNameId::Compare, which calls std::lexicographical_compare() with the template arguments, which are FullySpecifiedTypes. The result of FullySpecifiedType::operator<() might depend on a pointer comparison. Change-Id: I8d69d1bb5831145b1c21a5ea848c0043f17ec415 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* CppTools: Add a test for ObjC not replacing dot with arrowOrgad Shaneh2015-09-231-0/+10
| | | | | | Task-number: QTCREATORBUG-14583 Change-Id: Icffa9039215a841e200f20b83cda37d782b94e9a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Support ObjC in member access operator testsOrgad Shaneh2015-09-231-3/+18
| | | | | | | Actual test is added in a follow-up commit. Change-Id: I645d1e50d4ac9d281e31a0375f64fea849bf5e25 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Revert problematic template specialization changesNikolai Kosjar2015-09-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | This mainly reverts commit 81721f678122bc66213b5f2a5fbf36c43e5e1a35 C++: Fix resolving of recursive typedef commit 2070431d8ca867acfb4391c275cd82caff4d711a C++: Fix resolving of partial specialization and some bits of other changes due to dependencies. It also reverts commit e0594fc9b906a32f5c8ac70265490cf86044676f C++: Fix expensive lookup for boost which attempted to solve the upcoming problems. Task-number: QTCREATORBUG-14741 Task-number: QTCREATORBUG-14889 Task-number: QTCREATORBUG-14962 Change-Id: I3f9e1f97199e5199b71da394fc27051c7709bd1f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* C++: Add testsNikolai Kosjar2015-08-311-0/+96
| | | | | | | | | | ...for two regressions that were introduced by commit e0594fc9b906a32f5c8ac70265490cf86044676f C++: Fix expensive lookup for boost Change-Id: I1fa01e626da480ca53e04b4709fec458378e7aef Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: Fix expensive lookup for boostNikolai Kosjar2015-08-211-0/+18
| | | | | | | | | | | | | | | | | With this patch, CheckSymbols takes about 200ms for processing the boost/proto hello world example [1]. Before, it needed about 11 seconds (timer in CheckSymbols::run). Same goes for including <boost/fusion/include/zip.hpp>. The custom ProcessedSet object was added to support "completion for typedefs for templates in namespaces", but apparently that's not needed anymore, as the added test proves. [1] http://www.boost.org/doc/libs/1_58_0/doc/html/proto/users_guide.html#boost_proto.users_guide.getting_started.hello_world Task-numer: QTCREATORBUG-14889 Task-numer: QTCREATORBUG-14741 Change-Id: I90454e8970a9d04033d56beeb0c6d7a0d4e6cc62 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: Cleanup LookupContextOrgad Shaneh2015-07-011-0/+23
| | | | | | | | | | | | | | Since the cache is now more reliable, some workarounds and optimizations in the instantiation process are not needed anymore. Also avoid instantiation of base classes when expandTemplates is disabled. As a bonus, we now resolve decltype of template function for a type that is not referenced anywhere but in the decltype. Change-Id: Idf42ba7280992db477c9aa62bb1815b27174594d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Ignore explicit template instantiationsOrgad Shaneh2015-06-291-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Defined in section 14.7.2 of the standard. Fixes completion for std::string. The following explicit instantiation appears in bits/basic_string.tcc: extern template class basic_string<char>; This is wrongfully considered a specialization for a forward declaration (like `template<> class basic_string<char>` is). Introduce a new Symbol type for explicit instantiations. Use-case: template<class T> struct Foo { T bar; }; template class Foo<int>; void func() { Foo<int> foo; foo.bar; // bar not highlighted } Change-Id: I9e35c8c32f6b78fc87b4f4f1fc903b42cfbd2c2b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Resolve function-scope typedef inside lambdaOrgad Shaneh2015-06-291-0/+15
| | | | | | | | | | | | | | | | | Use-case: struct Foo { int bar; }; void func() { typedef Foo F; []() { F f; f.bar; // bar not highlighted }; } Change-Id: Ifaee2d125931d993acad69f03031a675c6180858 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix resolving of using in enclosing scopeOrgad Shaneh2015-06-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Use-case: namespace Ns { namespace Nested { struct Foo { void func(); int bar; }; } } using namespace Ns::Nested; namespace Ns { void Foo::func() { bar; // bar not highlighted } } Change-Id: I6e667d63eb40511d65532c4d6d317aa4028a87a4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Support default template argument lookup for specializationOrgad Shaneh2015-06-091-0/+13
| | | | | | | | | | | | | | | | | | | This fixes std::vector, although it doesn't really resolve numeric template arguments. It just picks the first specialization. Use-case: class Foo {}; template<class T1 = Foo> class Temp; template<> class Temp<Foo> { int var; }; void func() { Temp<> t; t.var; // var not highlighted } Task-number: QTCREATORBUG-8922 Change-Id: I593515beb3a6d901b6088db8bc1b8e16c39083d3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Improve accuracy in findSpecializationOrgad Shaneh2015-06-091-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * If a template type is specialized as a pointer, accept only pointers (of any type) * Same for references and arrays * Only if the specialized type is not part of the template, match it against the input. Fixes resolving of partial specialization with pointers. Use-cases: // 1 struct b {}; struct a : b {}; template<class X, class Y> struct s { float f; }; template<class X> struct s<X, b*> { int i; }; template<class X> struct s<X, a*> { char j; }; void f() { s<int, a*> var; var.j; // j not highlighted } // 2 template <typename T> struct Temp { T variable; }; template <typename T> struct Temp<T &> { T reference; }; void func() { Temp<int&> templ; templ.reference; // reference not highlighted } // 3 class false_type {}; class true_type {}; template<class T1, class T2> class and_type { false_type f; }; template<> class and_type<true_type, true_type> { true_type t; }; void func2() { and_type<true_type, false_type> a; a.f; // f not highlighted } Task-number: QTCREATORBUG-14036 Change-Id: Idee5e3f41d15c0772318d3837cbcd442cb80293a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix resolving of templated partial specializationOrgad Shaneh2015-06-041-0/+15
| | | | | | | | | | | | | | | | | | Use-case: template<class T> struct t {}; template<class> struct s { float f; }; template<class X> struct s<t<X>> { int i; }; void f() { s<t<char>> var; var.i; // i not highlighted } Task-number: QTCREATORBUG-14034 Change-Id: I5d00bc3247352fca4af4c41a47c208ec3e193c8e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix resolving of partial specializationOrgad Shaneh2015-06-041-0/+14
| | | | | | | | | | | | | | | | | Use-case: struct b {}; template<class X, class Y> struct s { float f; }; template<class X> struct s<X, b> { int i; }; void f() { s<int, b> var; var.i; // i not highlighted } Task-number: QTCREATORBUG-14036 Change-Id: I70a87499e0a375e84d992ca0a79d77270a3419e8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix lookup for instantiation of usingOrgad Shaneh2015-06-021-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yet another std::vector issue... Use-cases: // Case 1 template<typename T> using type = T; // Case 2 struct Parent { template<typename T> using type = T; }; // Case 3 template<typename T> struct ParentT { template<typename DT> using type = DT; }; struct Foo { int bar; }; void func() { type<Foo> p1; Parent::type<Foo> p2; ParentT<Foo>::type<Foo> p3; // bar not highlighted p1.bar; p2.bar; p3.bar; } Task-number: QTCREATORBUG-14480 Change-Id: I9ab08ea7360a432c48eb4b85aa0d63e08d2464c1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix decltype resolving for template functionOrgad Shaneh2015-06-011-0/+15
| | | | | | | | | | | | | | | | | | | | | The last nail for std::unique_ptr (GCC variant, MSVC still doesn't work). Use-case: template<typename T> static T f(); struct Foo { int bar; }; void fun() { decltype(f<Foo>()) s; s.bar; // bar not highlighted } Task-number: QTCREATORBUG-14483 Task-number: QTCREATORBUG-8937 Change-Id: I5bab757400b070cf9dbb688a44fd8eafe95ddc61 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix decltype resolving for nested instantiated classOrgad Shaneh2015-05-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The enclosingScope of a cloned nested class is not the original class but the cloned parent. Use-case: template <typename T> struct Temp { struct Nested { static T f(); typedef decltype(f()) type; }; }; struct Foo { int bar; }; void fun() { Temp<Foo>::Nested::type s; s.bar; // bar not highlighted } Task-number: QTCREATORBUG-14483 Change-Id: I3e15399a78a7492f740db8d0c7d5c84adf77d1d0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix resolving of recursive typedefOrgad Shaneh2015-05-201-1/+0
| | | | | | | | | | | | | | | | | | Use-case: template<typename _Tp> struct Temp { typedef _Tp value_type; }; struct Foo { int bar; }; void func() { Temp<Temp<Foo> >::value_type::value_type *p; p->bar; // bar not highlighted } Task-number: QTCREATORBUG-14237 Change-Id: Ie0b21b81526d610437ed2d2877083bb929c25047 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: fix code completion for decltyped typeOrgad Shaneh2015-05-201-0/+23
| | | | | | | | | | | | | | | | | | | | example: struct Foo { int bar; }; Foo foo() { return Foo; } typedef decltype(foo()) TypedefedFooWithDecltype; void fun() { decltype(foo()) decltypeFoo; decltypeFoo.;// code completion should work here TypedefedFooWithDecltype typedefedFooWithDecltype; typedefedFooWithDecltype.;// code completion should work here } Started-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Task-number: QTCREATORBUG-14483 Change-Id: I296ceed9d896c68cf0651265afb08a1fc42f9a68 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix explicit typedef from base type in templated classOrgad Shaneh2015-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Use-case: struct Foo { int bar; }; template<typename T> struct Base { typedef T F; }; template<typename T> struct Derived : Base<T> { typedef typename Base<T>::F F; F f; }; void func() { Derived<Foo> d; d.f.bar; // bar not highlighted } Task-number: QTCREATORBUG-14218 Change-Id: Ic0b22b2f8adf80ff88a2f8b7359c276a744f89e8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix lookup for instantiation by class objectOrgad Shaneh2015-05-151-1/+22
| | | | | | Task-number: QTCREATORBUG-14352 Change-Id: I2ce4bc1d0dba2414afe050e80607b581686081a9 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.4'Eike Ziller2015-05-071-3/+28
|\ | | | | | | | | | | | | Conflicts: src/libs/extensionsystem/pluginview.cpp Change-Id: I410156c1003d5dc81e915110c6d432bcd71da010
| * CppTools: Offer "override" and "final" as completion itemsNikolai Kosjar2015-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | These are special identifiers and were thus not included in the 'add all keywords' handling. Change-Id: I7f65df5711193e945bfa955dcb70a6ab454606b5 Task-number: QTCREATORBUG-11341 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
| * CppTools: Fix global completion after "/// text."Nikolai Kosjar2015-04-241-3/+26
| | | | | | | | | | | | | | | | | | | | | | Like for other comments, don't try member completion if the doxygen comment ends with a dot. Task-number: QTCREATORBUG-8597 Change-Id: I2d5204ba8f45fc9ee94e285a907364cc722e62c7 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* | C++: Fix specialization resolution for nested typesOrgad Shaneh2015-04-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use-cases: template<typename T> struct Traits { typedef typename T::pointer pointer; }; template<typename _Tp> struct Traits<_Tp*> { typedef _Tp *pointer; }; struct Foo { int bar; }; // 1 template<typename T> class Temp { protected: typedef Traits<T> TraitsT; public: typedef typename TraitsT::pointer pointer; pointer p; }; void func() { Temp<Foo *> t; t.p-> // complete } // 2 class Temp2 { protected: typedef Foo *FooPtr; typedef Traits<FooPtr> TraitsT; public: typedef typename TraitsT::pointer pointer; pointer p; }; void func2() { Temp2 t; t.p-> // complete } Task-number: QTCREATORBUG-14141 Change-Id: Id3459671117c0c81bcde7c9714b42750634c0225 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | C++: Improve template argument detection for nested typesOrgad Shaneh2015-04-231-0/+23
| | | | | | | | | | Change-Id: I7dd3f552f0e85413de8e58047d1fba39c7237182 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | Merge remote-tracking branch 'origin/3.4'Eike Ziller2015-04-151-8/+35
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/libs/timeline/qml/MainView.qml src/plugins/git/gitclient.cpp Change-Id: I0b6ec7b9a592014deb0dd2e1145b19dd6753b1c3
| * CppTools: Fix global completion after '&'Nikolai Kosjar2015-04-131-8/+35
| | | | | | | | | | | | | | | | | | | | | | Regression introduced by commit 9fb5b0be15a1d877132942ca5da1829510f23361 CppTools: Add basic completion support for qt5 style signals/slots Change-Id: I0a8e5ef31c1394512a51a26ed08b0f445add5acd Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* | CppTools: Add failing tests for recursive instantiationOrgad Shaneh2015-04-111-0/+32
|/ | | | | | Task-number: QTCREATORBUG-14237 Change-Id: I59ae931994ef6577010a4544219ba3b0cd85c677 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
* CppTools: Add a failing test for explicit template base typedefOrgad Shaneh2015-04-011-0/+29
| | | | | | Task-number: QTCREATORBUG-14218 Change-Id: I1cccc522f0d484e966f97bea86236e83caec754a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Add 2 failing tests for double pointer indirectionOrgad Shaneh2015-04-011-0/+72
| | | | | | | ... when resolving specialization Change-Id: Id3b673fa0c85b13f9a3b4bda022ef2ff18d4c2ac Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Add another failing test for indirect pointer specializationOrgad Shaneh2015-03-251-2/+32
| | | | | | Task-number: QTCREATORBUG-14141 Change-Id: I5f2187da15091027b2e71228b7cba048514c1005 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Fix bug reference for failing testOrgad Shaneh2015-03-241-1/+1
| | | | | | | It doesn't look like the same issue. Change-Id: I6f3b588ebd09f8f74a9fd714e6fbf987b02304d1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Add a failing test for partial template specializationOrgad Shaneh2015-03-131-0/+30
| | | | | | Task-number: QTCREATORBUG-14036 Change-Id: I7545bfa40ec3e1399d57bf5ab2486318aa1fcb9f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix nested type resolving in member functionsOrgad Shaneh2015-03-051-1/+34
| | | | | | | Task-number: QTCREATORBUG-13976 Task-number: QTCREATORBUG-13978 Change-Id: I598f9cb99ffd044abfc6ed9aa16d4a3045985008 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
* CppTools: Move languageFeatures around in CompletionAssist...Orgad Shaneh2015-02-271-1/+4
| | | | | | | ... from InternalCppCompletionAssistProcessor to CppCompletionAssistInterface Change-Id: I769fd86a387f1087f37b56fe114bdf132f1b0be7 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Clean exported headers of the TextEditor plugin.Friedemann Kleint2015-02-261-0/+2
| | | | | Change-Id: I1e7dd34ba5a51fb0b34d137dc03add4457b32ed1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: Fix crash on static template instantiationOrgad Shaneh2015-02-261-0/+21
| | | | | | | | | | | | | | | | | | | | | | | template<typename T> struct QList { struct iterator { T *operator->() { return &t; } T t; }; static iterator begin() { return iterator(); } }; struct Foo { int bar; }; void fun() { auto a = QList<Foo>::begin(); a. // crash } Change-Id: I373c493b2eefc9566ec13165285c33d474a3b440 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: fix dereferencing of nested type and 'auto'Przemyslaw Gorszkowski2015-02-261-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed case: template<class T> struct List { struct iterator { T *operator->() { return &t; } T &operator*() { return t; } T t; }; iterator begin() { return iterator(); } }; struct Foo { int bar; }; void func() { List<Foo> list; auto a = list.begin(); (*a).; // code completion doesn't work a->; // code completion does not work } Task-number: QTCREATORBUG-13799 Change-Id: I38e4bfb2f5d728c0b24b0f18b3d78793e90d633b Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: fix dereferencing of nested type and operator '->'Przemyslaw Gorszkowski2015-02-251-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed case: template<class T> struct List { struct iterator { T *operator->() { return &t; } T t; }; iterator begin() { return iterator(); } }; struct Foo { int bar; }; void func() { List<Foo> list; list.begin()->; // code completion doesn't work } Task-number: QTCREATORBUG-13799 Change-Id: I65e8d3092bbc9b01a5dbee241c24d95dd03fc670 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: fix dereferencing of nested type and operator '*'Przemyslaw Gorszkowski2015-02-251-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed case: template<class T> struct List { struct iterator { T &operator*() { return t; } T t; }; iterator begin() { return iterator(); } }; struct Foo { int bar; }; void func() { List<Foo> list; (*list.begin()).; // code completion doesn't work } Task-number: QTCREATORBUG-13799 Change-Id: Ia3f5c1631c2f6a25d7fb1186b4ef506354ed22be Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Fix completing qt5 style signals/slots in connect()Nikolai Kosjar2015-02-201-24/+55
| | | | | | | | | | | | | | | * Fix qualifying the member function, take namespace into account * Fallback to usual completion if we cannot provide anything * Ensure that the completion is not triggered outside connect() calls * Change to a two step process: 1. connect(obj, & // offer class name completion 2. connect(obj, &N::Foo:: // offer signal completions ...same for the 4th. argument. Change-Id: Ifa4c74cde1b96ec7c544daaeefc47c4efdd8294a Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* CppTools: Tests: time out in waitForFileInGlobalSnapshot()Nikolai Kosjar2015-02-181-2/+1
| | | | | Change-Id: I0bf7d826d53749c5fd1be1e4f3c2faa403d13342 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* CppTools: Add basic completion support for qt5 style signals/slotsNikolai Kosjar2015-02-171-0/+88
| | | | | | | | | | | Trigger completion for Qt5 signals/slots as soon as the user types '&' in connect(object, & connect(object, &Foo:signal, object2, & Change-Id: I338a26415196959e3dc413bdfd023314812f3aaa Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>