summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* C++: fix nested anonymous with __attribute__Przemyslaw Gorszkowski2014-06-061-0/+14
| | | | | | | Task-number: QTCREATORBUG-12345 Change-Id: Ib2316ebdc81393b38185b9cb659fb85b78753e7b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Revert "C++: nested class with enclosing template class"Nikolai Kosjar2014-04-091-0/+2
| | | | | | | | | | This reverts commit 5d76b4339a717cd944c4a3c27eac860b8111d645 since it might lead to an infinite loop. Task-number: QTCREATORBUG-11999 Change-Id: I12c7f3afc4aa53a83ddc2bf2d33eb76c29b747ee Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: nested class with enclosing template classPrzemyslaw Gorszkowski2014-04-041-0/+16
| | | | | | | | | | | The parent of instantiation of nested class of template class should be the instantiation of enclosing template class. Task-number: QTCREATORBUG-11752 Change-Id: I8875c738848b85731f5ea88a60da190b4b0ad18f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: fix support for nested anonymous classPrzemyslaw Gorszkowski2014-03-261-0/+14
| | | | | | | | | | | | The case when anonymous class is inside function. Fixed: * highlighting * completion Task-number: QTCREATORBUG-11711 Change-Id: Ic8fc5fdfb1aed62a74bf148ab7ed449d08214dda Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: nested class in functionPrzemyslaw Gorszkowski2014-03-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | Case when nested class declaration contains object name for this class. Example: void fun() { struct S { int i; } s; s.i; } Fixes: * highlighting * completion * tests Task-number: QTCREATORBUG-11710 Change-Id: I32e234f57655c388a87a199edc8be750d7bf823f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Do not set binding block as instantiationOriginPrzemyslaw Gorszkowski2014-03-251-0/+16
| | | | | | | | | | | The binding in a block should not be used as an instantiationOrigin, because it will be deleted if it does not contain any blocks or namespaces or classes or enums. Instead of that we should look for first enclosing class or namespace. Task-number: QTCREATORBUG-11424 Change-Id: I0fc6e935495478f71372b0fe6f611887f45b2eda Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: fix support for nested anonymous classesPrzemyslaw Gorszkowski2014-03-121-1/+62
| | | | | | | | | | | | | | | | | | | A member of nested anonymous class should be visible as a member of enclosing class(if there is no declaration of this nested anonymous class). Fix: * marking * find usage * follow symbol * completion Task-number: QTCREATORBUG-10876 Task-number: QTCREATORBUG-11170 Change-Id: If5b4d198e9075f2a8aa899ae59190f2c05f7b1ff Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Add tests for nested enumsOrgad Shaneh2014-01-241-0/+39
| | | | | | | | | Discarded during merge from 3.0 Task-number: QTCREATORBUG-5456 Change-Id: I0bb4756e3cdf3c87a4c2b0fbfe6953faaa5e1c52 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@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: Don't continue in test function on failureNikolai Kosjar2014-01-071-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | QVERIFY/QCOMPARE are meant to be called in the test function so that on failure they just can "return" and thus skip subsequent code. Since we use reusable test code in the test functions (the *TestCase classes), we need to ensure that on failure no further test code is executed. This mostly inlines the run function of the test classes into the constructor. Change-Id: I320ee032bdde0174ddfe3fdf3f9e18e19abf1d7f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppEditor/CppTools: Clean up *Test* classesNikolai Kosjar2014-01-071-28/+33
| | | | | | | | | | | | | | | | * Unify class names * Fix coding style Change-Id: I7498192ba9e6b9fc0e97d3d4f0dbb30f1853a0c9 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppEditor/CppTools: Introduce Test{Case,Document}Nikolai Kosjar2014-01-071-26/+12
| | | | | | | | | | | | | | Move common functionality of the 12 test classes into base classes. Change-Id: If64d3cec876807ac6f991151189860a99b8ff4ca Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppTools: Add completion tests for enums inside class/namespaceOrgad Shaneh2013-12-281-0/+74
| | | | | | | | | | Change-Id: If088533d0b51d1750e3273d7ab732dffd110ec85 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Uncomment a test and fix itOrgad Shaneh2013-12-281-24/+23
| | | | | | | | | | | | | | The bug was fixed long time ago, the test is missing a semicolon Change-Id: I0236048d2da059fe208591469fb69541705463cf Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Replace comma with dot for test namesOrgad Shaneh2013-12-281-3/+3
| | | | | | | | | | | | | | Comma is used to separate tests on command-line Change-Id: I785d2137d54b0e1e4edbbd940042dc926719dcfc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Fix indentation for some completion testsOrgad Shaneh2013-12-231-35/+35
| | | | | | | | | | Change-Id: I9a5bf4705da5ca88776dec70057da2c64e4c1494 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Make completion tests data-drivenOrgad Shaneh2013-12-231-1227/+563
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly done using the following Ruby script: Fname = 'src/plugins/cpptools/cppcompletion_test.cpp' s = File.read(Fname) mod = s.gsub(/(?<declaration>void CppToolsPlugin::test_(?<test_name>[^(]+)\(\)\n\{)(?<body>.*?\n)\}/m) { |func| match = $~ declaration = match['declaration'] body = match['body'] test_name = match['test_name'].sub('_data', '') final = body.gsub(/(?:completions.clear\(\);\s+)?(?: +)[^\n]* =\n(?<code>.*?);\s*(?<completions>(?:completions.append\(QLatin1String\("[^"]*"\)\);\s*)*)QTest::newRow\("case: (?<name>.+?)"\)\s*<< code << _\("(?<prefix>[^"]+)"\) << completions;/m) { m = $~ res = " QTest::newRow(\"#{test_name}: #{m['name']}\") << _(\n#{m['code'].rstrip}\n ) << _(\"#{m['prefix']}\") << (QStringList()" m['completions'].scan(/completions.append\((.+)\);/) { |comp| res << "\n << #{comp[0]}" } res + ');' }.gsub(/(?: +)[^\n]* =\n(?<code>.*?);\n\s*CompletionTestCase test\(.+?, "(?<prefix>.+?)"\);\s*QStringList expected;\s*(?<completions>(?:expected.append\(QLatin1String\("[^"]*"\)\);\s*)*)const QStringList completions = test.getCompletions\(\);\s*QCOMPARE\(completions, expected\);/m) { m = $~ res = " QTest::newRow(\"#{test_name}\") << _(\n#{m['code'].rstrip}\n ) << _(\"#{m['prefix']}\") << (QStringList()" m['completions'].scan(/expected.append\((.+)\);/) { |comp| res << "\n << #{comp[0]}" } res + ');' }.gsub(/(?: +)[^\n]* =\n(?<code>.*?);\n\s*CompletionTestCase test\(.+?(?:, (?<prefix>".+?"))?\);\s*(?:const )?QStringList completions = test.getCompletions\(\);\s*QCOMPARE\(completions.size\(\), \d+\);(?<completions>(?:\s*QVERIFY\(completions.contains\([^\n]+\);)*)\n/m) { |mm| m = $~ res = " QTest::newRow(\"#{test_name}\") << _(\n#{m['code'].rstrip}\n ) << _(#{m['prefix']}) << (QStringList()" m['completions'].scan(/QVERIFY\(completions.contains\((.+?)\)\);/) { |comp| res << "\n << #{comp[0]}" } res + ");\n" }.gsub(/(?: +)[^\n]* =\n(?<code>.*?);\n\s*CompletionTestCase test\(.+?(?:, (?<prefix>".+?"))?\);\s*bool replaceAccessOperator = false;\s*const QStringList completions = test.getCompletions\(\&replaceAccessOperator\);\s*QCOMPARE\(completions.size\(\), \d+\);(?<completions>(?:\s*QVERIFY\(completions.contains\([^\n]+\);)*)\s*QVERIFY\((?<replace>!?)[^)]*\);\n/m) { |mm| m = $~ res = " QTest::newRow(\"#{test_name}\") << _(\n#{m['code'].rstrip}\n ) << _(#{m['prefix']}) << (QStringList()" m['completions'].scan(/QVERIFY\(completions.contains\((.+?)\)\);/) { |comp| res << "\n << #{comp[0]}" } res + ")\n << #{m['replace'].empty?};\n" } if final == body or final['QTest::addColumn'] declaration + final + "}" else final end }.gsub(/QTest::newRow\("([^"]+)"/) { |m| name = $1 if name.size > 73 space = name[0..73].rindex(/[ _]/) "QTest::newRow(\"#{name[0..space]}\"\n \"#{name[space+1..-1]}\"" else m end }.gsub(/\s+QTest::newRow/, "\n\n QTest::newRow") if mod != s File.open(Fname, 'wt').write(mod) end Change-Id: Id6bfb03cdf31ac27b36028fcdc861c340a5398f4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Reorder completion testsOrgad Shaneh2013-12-231-316/+316
| | | | | | | | | | | | | | For reasonable diff on following commit Change-Id: I97e121355279f9166cea2f500cf2d4df5fafaa32 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Generalize data-driven test_completionOrgad Shaneh2013-12-231-37/+54
| | | | | | | | | | Change-Id: I409a00b869a95dff2d69c9744da75c324c82776a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Cleanup completion tests #2Orgad Shaneh2013-12-231-71/+70
| | | | | | | | | | Change-Id: I3c5f42de464a5607f1caa6a48d881c5a4a113ec3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Remove superfluous comments from completion testsOrgad Shaneh2013-12-231-86/+10
| | | | | | | | | | Change-Id: I2526daeaf54f7f8d4b808cf556cff9242adaa391 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge BaseTextEditorWidget::editorDocument() and ::baseTextDocument()Eike Ziller2013-12-181-1/+1
|/ | | | | | | | Doesn't really make sense to have the additional IDocument *editorDocument() method. Change-Id: I0a7420eb1afaa76f63c3f7e9c4b373acf624ffb9 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: fix auto completion for member of classes accessed by usingPrzemyslaw Gorszkowski2013-11-221-0/+43
| | | | | | | | | | | | | | 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>
* C++: Limit typedef resolving depthNikolai Kosjar2013-10-181-49/+49
| | | | | | | | | | | 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/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "EditorManager: Fix crash when closing an editor upon activation"Orgad Shaneh2013-10-081-2/+1
| | | | | | | | | | | | | | | Deleting an editor while currentEditorChanged is apparently not a good idea. Use a queued connection instead. This reverts commits 243a6259618e69b8da9ac2438480c449754f7f77, 447c4ed37f8904ca733d6e6253ad19bb0388f209, d9602ca550c53e60a5229bfec9539e41fa5a694c and 31034870389a512e3450e32ed990e1622bd6e679. Change-Id: Iccbee25fb77714963faa6f7184d1f5f53ed348a6 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Merge remote-tracking branch 'origin/2.8'Eike Ziller2013-10-011-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/coreplugin/coreplugin.pro src/plugins/coreplugin/coreplugin.qbs src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppquickfix_test.cpp src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp src/plugins/cpptools/cppcompletion_test.cpp Change-Id: I392229af933c1e56b9ea459d4d240a2144b4bfcb
| * CppEditor/CppTools: Fix plugin tests.Nikolai Kosjar2013-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with commit 243a625 EditorManager::closeEditors() does not delete the editors anymore, but calls deleteLater(). When the call returns, all kind of checks fail since the editor widget destructor was not yet called. Fixed by providing and calling Core::Tests::closeAndDeleteEditors(), which explicitly sends QEvent::DeferredDelete to the widget. Change-Id: I3287abbe74ccf7d7a18b997a847701c8be17cb55 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Completions: move continuations upper in proposals list.Alexey Semenko2013-09-031-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | EditorManager: Use static pattern, adjust surrounding codehjk2013-08-301-1/+1
| | | | | | | | | | Change-Id: I3255a0150cd9a730336456c5a9f986eb74fefbff Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* | Merge remote-tracking branch 'origin/2.8'Oswald Buddenhagen2013-08-211-859/+339
|\ \ | |/ | | | | | | | | | | | | | | | | 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: Tests: Refactor / Clean up cppcompletion_test.cppNikolai Kosjar2013-07-311-649/+247
| | | | | | | | | | | | | | | | | | * Open the files in the cpp editor, so preprocessing will take place * Remove duplicated code * Fix coding styles issues Change-Id: Ic8bffcbc5a4ac5aca76bc55880d33c3b55f0944c Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
| * CppTools: Hide "QPrivateSignal" on signal completion (Qt5)Nikolai Kosjar2013-07-311-0/+33
| | | | | | | | | | | | | | | | | | | | 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>
* | AutoTests: fix test framework in case of tests for class membersPrzemyslaw Gorszkowski2013-08-141-0/+6
| | | | | | | | | | Change-Id: I564ea9cccc24509957481b6726f25833f35a4da4 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix auto completion for template parametersPrzemyslaw Gorszkowski2013-08-051-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | 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>
* | C++: fix local types and membersPrzemyslaw Gorszkowski2013-07-121-0/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | 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++: add support for local typesPrzemyslaw Gorszkowski2013-06-181-0/+227
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* C++: Handle recursive using/typedef declarationsNikolai Kosjar2013-06-111-0/+137
| | | | | | | | 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/+53
| | | | | | | | | | | 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/+34
|\ | | | | | | | | | | | | | | | | | | | | | | 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/+34
| | | | | | | | | | | | | | | | | | 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 used template function parametersPrzemyslaw Gorszkowski2013-05-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | It was missing colorizing and follow symbol template function parameters in case of: * returning value * use it as qualified name Task-number: QTCREATORBUG-6861 Change-Id: I4226199e1f296cfe5a373783ebbc633e32fc9bcd Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix typedefed structPrzemyslaw Gorszkowski2013-05-241-2/+166
| | | | | | | | | | | | | | | | | | | | 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/+29
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-9170 Change-Id: I4cac9124558c1d4f0722192246f3fbeea61d3d7d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: added missing cloning of AnonymousNameIdPrzemyslaw Gorszkowski2013-05-101-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | 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/+133
| | | | | | | | | | | | | | | | Looking for using declaration when lookup a type Task-number: QTCREATORBUG-2668 Change-Id: I11600c5be262840472dd4c9e72334760a35aa4a0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>