summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'Eike Ziller2015-02-121-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/tooltip/tipcontents.cpp src/libs/utils/tooltip/tipcontents.h src/plugins/android/androiddeployqtstep.cpp src/plugins/baremetal/baremetalconstants.h src/plugins/baremetal/baremetaldevice.cpp src/plugins/baremetal/baremetaldevice.h src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp src/plugins/baremetal/baremetaldeviceconfigurationwidget.h src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h src/plugins/baremetal/baremetalplugin.cpp src/plugins/baremetal/baremetalplugin.h src/plugins/baremetal/baremetalruncontrolfactory.cpp src/plugins/baremetal/baremetalruncontrolfactory.h src/plugins/cppeditor/cppcodemodelinspectordialog.cpp src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppdoxygen_test.h src/plugins/debugger/breakpointmarker.cpp src/plugins/debugger/debuggeritemmodel.cpp src/plugins/debugger/debuggeritemmodel.h src/plugins/debugger/loadcoredialog.cpp src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp src/plugins/projectexplorer/addnewmodel.cpp src/plugins/projectexplorer/addnewmodel.h src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp src/plugins/qmlprofiler/abstracttimelinemodel.cpp src/plugins/qmlprofiler/abstracttimelinemodel.h src/plugins/qmlprofiler/notesmodel.cpp src/plugins/qmlprofiler/qml/CategoryLabel.qml src/plugins/qmlprofiler/qml/MainView.qml src/plugins/qmlprofiler/qml/Overview.js src/plugins/qmlprofiler/qml/Overview.qml src/plugins/qmlprofiler/qml/TimeDisplay.qml src/plugins/qmlprofiler/qml/TimeMarks.qml src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp src/plugins/qmlprofiler/sortedtimelinemodel.cpp src/plugins/qmlprofiler/sortedtimelinemodel.h src/plugins/qmlprofiler/timelinemodelaggregator.cpp src/plugins/qmlprofiler/timelinemodelaggregator.h src/plugins/qmlprofiler/timelinerenderer.cpp src/plugins/qmlprofiler/timelinerenderer.h src/plugins/qmlprojectmanager/QmlProjectManager.json.in src/plugins/texteditor/findinfiles.cpp src/plugins/vcsbase/vcsconfigurationpage.cpp src/shared/qbs src/shared/scriptwrapper/interface_wrap_helpers.h src/shared/scriptwrapper/wrap_helpers.h tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp tests/system/suite_debugger/tst_debug_empty_main/test.py tests/system/suite_debugger/tst_qml_js_console/test.py tests/system/suite_debugger/tst_qml_locals/test.py Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
| * Update LicenseEike Ziller2015-01-161-6/+6
| | | | | | | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | C++: Remove unneeded qualificationsOrgad Shaneh2015-02-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly done using the following ruby script: Dir.glob('**/*.cpp').each { |file| next if file =~ %r{src/shared/qbs|/qmljs/} s = File.read(file) s.scan(/^using namespace (.*);$/) { ns = $1 t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m| before = $1 char = $2 if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/ m else before + char end } if t != s puts file File.open(file, 'w').write(t) end } } Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | C++: fix auto declaration in if conditionPrzemyslaw Gorszkowski2015-02-041-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for auto completion in case of auto declaration inside if condition: struct Foo { int bar; }; void func() { if (auto s = new Foo) s->; // auto completion does not work } Task-number: QTCREATORBUG-13805 Change-Id: Ia1776e8cc04e6040a6bf5f43cf82cfd6ce6dde7a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | CppTools: Rename CppCompletionAssistProcessor to InternalCpp...Nikolai Kosjar2015-01-211-1/+1
| | | | | | | | | | | | | | | | We will introduce a base class with the name CppCompletionAssistProcessor. Change-Id: I74a39d0b14d4ee30d7bd7675ad968e83f377de7f Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | C++: Fix completion for enum inside member functionsOrgad Shaneh2015-01-131-3/+0
| | | | | | | | | | | | | | | | Take 2 Task-number: QTCREATORBUG-13757 Change-Id: I9c2558bf01121e53710db984a99d37c2c6cafaf4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | Core: Use FileName for file path in IDocumentOrgad Shaneh2015-01-121-1/+1
| | | | | | | | | | Change-Id: I85f7398aee59d0d36f0e5c3bf88ff3c96002e394 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* | Revert "C++: Fix completion for enum inside member functions"Orgad Shaneh2015-01-061-0/+3
| | | | | | | | | | | | | | | | | | Breaks loading of qtcreator project. This reverts commit 4c6ad5e3055cc4028920828ccad428dca4329766. Change-Id: I7c4cdaf57eed16d7643d05b9456e03d5120259b3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | C++: Fix completion for enum inside member functionsOrgad Shaneh2015-01-061-3/+0
| | | | | | | | | | | | Task-number: QTCREATORBUG-13757 Change-Id: I283306b0c8348ee82e8e9bf47d404c1ecd473fde Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | CppTools: Cover all permutations for each enum testcaseOrgad Shaneh2015-01-061-105/+95
| | | | | | | | | | | | | | | | | | | | | | | | * named enum, access by value names * named enum, access by enum name (C++11) * anonymous enum + Add some failing tests Task-number: QTCREATORBUG-13757 Change-Id: I7b0a859805a5979c3c886a6dbec703639fb374be Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | CppTools: Tests: Stop writing into source dirNikolai Kosjar2014-12-191-2/+5
|/ | | | | | | | | | | | | | Instead, always write into a unique temporary directory in QDir::tempPath(). Where applicable, read the test source from files instead of first writing the file. Some clean ups in test_codegen*. Change-Id: Id48dc50c6ca16252edfd9fc8a86ba0de9f9be486 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.2'Eike Ziller2014-10-141-7/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/ipaddresslineedit.cpp src/libs/utils/logging.h src/plugins/analyzerbase/AnalyzerBase.pluginspec.in src/plugins/android/Android.pluginspec.in src/plugins/android/androiddeploystep.cpp src/plugins/android/androiddeploystep.h src/plugins/android/androiddeploystepfactory.cpp src/plugins/android/androiddeploystepwidget.cpp src/plugins/android/androidpackagecreationfactory.cpp src/plugins/android/androidpackagecreationstep.cpp src/plugins/android/androidpackagecreationstep.h src/plugins/android/androidpackagecreationwidget.cpp src/plugins/android/androidpackagecreationwidget.h src/plugins/android/javafilewizard.cpp src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/baremetal/BareMetal.pluginspec.in src/plugins/bazaar/Bazaar.pluginspec.in src/plugins/beautifier/Beautifier.pluginspec.in src/plugins/bineditor/BinEditor.pluginspec.in src/plugins/bookmarks/Bookmarks.pluginspec.in src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in src/plugins/clangcodemodel/clanghighlightingsupport.cpp src/plugins/clangcodemodel/clangsymbolsearcher.cpp src/plugins/classview/ClassView.pluginspec.in src/plugins/clearcase/ClearCase.pluginspec.in src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp src/plugins/cmakeprojectmanager/cmakehighlighter.cpp src/plugins/coreplugin/Core.pluginspec.in src/plugins/cpaster/CodePaster.pluginspec.in src/plugins/cppeditor/CppEditor.pluginspec.in src/plugins/cppeditor/cppfilewizard.cpp src/plugins/cpptools/CppTools.pluginspec.in src/plugins/cpptools/cpphighlightingsupportinternal.cpp src/plugins/cpptools/cppmodelmanagerinterface.cpp src/plugins/cpptools/cppmodelmanagerinterface.h src/plugins/cvs/CVS.pluginspec.in src/plugins/debugger/Debugger.pluginspec.in src/plugins/designer/Designer.pluginspec.in src/plugins/diffeditor/DiffEditor.pluginspec.in src/plugins/emacskeys/EmacsKeys.pluginspec.in src/plugins/fakevim/FakeVim.pluginspec.in src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in src/plugins/git/Git.pluginspec.in src/plugins/git/gitorious/gitorious.cpp src/plugins/git/gitorious/gitorious.h src/plugins/git/gitorious/gitoriousclonewizard.cpp src/plugins/git/gitorious/gitorioushostwidget.cpp src/plugins/git/gitorious/gitorioushostwidget.h src/plugins/git/gitorious/gitorioushostwizardpage.cpp src/plugins/git/gitorious/gitoriousprojectwidget.cpp src/plugins/git/gitorious/gitoriousprojectwidget.h src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp src/plugins/git/gitorious/gitoriousprojectwizardpage.h src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp src/plugins/git/gitorious/gitoriousrepositorywizardpage.h src/plugins/glsleditor/GLSLEditor.pluginspec.in src/plugins/glsleditor/glsleditorfactory.cpp src/plugins/glsleditor/glslfilewizard.cpp src/plugins/helloworld/HelloWorld.pluginspec.in src/plugins/help/Help.pluginspec.in src/plugins/imageviewer/ImageViewer.pluginspec.in src/plugins/ios/Ios.pluginspec.in src/plugins/macros/Macros.pluginspec.in src/plugins/mercurial/Mercurial.pluginspec.in src/plugins/perforce/Perforce.pluginspec.in src/plugins/projectexplorer/ProjectExplorer.pluginspec.in src/plugins/pythoneditor/PythonEditor.pluginspec.in src/plugins/pythoneditor/pythoneditorwidget.cpp src/plugins/pythoneditor/wizard/pythonfilewizard.cpp src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in src/plugins/qmakeprojectmanager/profileeditorfactory.cpp src/plugins/qmldesigner/QmlDesigner.pluginspec.in src/plugins/qmljseditor/QmlJSEditor.pluginspec.in src/plugins/qmljseditor/qmljseditorfactory.cpp src/plugins/qmljstools/QmlJSTools.pluginspec.in src/plugins/qmlprofiler/QmlProfiler.pluginspec.in src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in src/plugins/qnx/Qnx.pluginspec.in src/plugins/qtsupport/QtSupport.pluginspec.in src/plugins/remotelinux/RemoteLinux.pluginspec.in src/plugins/resourceeditor/ResourceEditor.pluginspec.in src/plugins/resourceeditor/resourcewizard.h src/plugins/subversion/Subversion.pluginspec.in src/plugins/tasklist/TaskList.pluginspec.in src/plugins/texteditor/TextEditor.pluginspec.in src/plugins/texteditor/basetexteditor_p.h src/plugins/texteditor/basetextmark.cpp src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h src/plugins/texteditor/codeassist/defaultassistinterface.h src/plugins/texteditor/codeassist/iassistproposalitem.cpp src/plugins/texteditor/itexteditor.cpp src/plugins/texteditor/itexteditor.h src/plugins/texteditor/itextmark.cpp src/plugins/texteditor/plaintexteditor.cpp src/plugins/texteditor/plaintexteditor.h src/plugins/texteditor/texteditoractionhandler.cpp src/plugins/todo/Todo.pluginspec.in src/plugins/updateinfo/UpdateInfo.pluginspec.in src/plugins/valgrind/Valgrind.pluginspec.in src/plugins/vcsbase/VcsBase.pluginspec.in src/plugins/welcome/Welcome.pluginspec.in src/plugins/winrt/WinRt.pluginspec.in tests/auto/debugger/temporarydir.h Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
| * License updateEike Ziller2014-10-091-7/+8
| | | | | | | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | TextEditor: Rename BaseTextEditorWidget to TextEditorWidgethjk2014-09-291-2/+2
| | | | | | | | | | | | | | ... and some of the related implementation details Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d Reviewed-by: David Schulz <david.schulz@digia.com>
* | TextEditor: More BaseText* -> Text* renamingshjk2014-09-261-1/+1
| | | | | | | | | | | | | | *Document* and *Layout* classes, all basetext* files Change-Id: I1c6e376733a434fcb5c7f19c6210dfa031eeafde Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | CppTools: Tests: Fix leaking IAssistProposal and SymbolSearcherNikolai Kosjar2014-09-221-4/+5
| | | | | | | | | | Change-Id: Ic81a5df88d17375cf0087213d84443845bfd38cc Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* | Revert "C++: add support for resolving typedefs for template arguments"Nikolai Kosjar2014-09-111-28/+0
| | | | | | | | | | | | | | | | | | | | | | This reverts commit c228b36ccf92f3a75d7687159d99da496cf5e241. There are multiple issues with the reverted patch: * Infinite loop due to indirect recursion e.g. when opening projectmodels.cpp * Crash when executing CppTools tests on Windows (no infinite loop) Change-Id: I38f02132ca57d3d32085db6146d0df7d620d7618 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: add support for resolving typedefs for template argumentsPrzemyslaw Gorszkowski2014-09-091-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: template <typename T> struct Base { T t; }; struct Foo { int foo; }; void fun() { typedef Foo TypedefedFoo; Base<TypedefedFoo> baseFoo; baseFoo.t.// no code completion } Change-Id: I4822693d3fa1ee2e9b0e4cdd28bb9a8d441fb313 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: Base parsing on editor document instead of widgetNikolai Kosjar2014-08-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mainly takes CppEditorSupport apart. * Parsing is now invoked by CPPEditorDocument itself by listening to QTextDocument::contentsChanged(). * Upon construction and destruction CPPEditorDocument creates and deletes an EditorDocumentHandle for (un)registration in the model manager. This handle provides everything to generate the working copy and to access the editor document processor. * A CPPEditorDocument owns a BaseEditorDocumentProcessor instance that controls parsing, semantic info recalculation and the semantic highlighting for the document. This is more or less what is left from CppEditorSupport and can be considered as the backend of a CPPEditorDocument. CPPEditorDocument itself is quite small. * BuiltinEditorDocumentProcessor and ClangEditorDocumentProcessor derive from BaseEditorDocumentProcessor and implement the gaps. * Since the semantic info calculation was bound to the widget, it also calculated the local uses, which depend on the cursor position. This calculation got moved into the extracted class UseSeletionsUpdater in the cppeditor plugin, which is run once the cursor position changes or the semantic info document is updated. * Some more logic got extracted: - SemanticInfoUpdater (logic was in CppEditorSupport) - SemanticHighlighter (logic was in CppEditorSupport) * The *Parser and *Processor classes can be easily accessed by the static function get(). * CppHighlightingSupport is gone since it turned out to be useless. * The editor dependency in CompletionAssistProviders is gone since we actually only need the file path now. Change-Id: I49d3a7bd138c5ed9620123e34480772535156508 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | search for partial specialization for arraysFilipp2014-08-201-0/+39
| | | | | | | | | | | | | | | | | | A<int[]> now prefer second specialization for template<typename T> class A template<typename T> class A<[]> Change-Id: I32e874f78b2f5b363d088fbab6a8897e42e44035 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: fix code completion for typedef of pointer arrayPrzemyslaw Gorszkowski2014-08-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: struct Foo { int foo; }; typedef Foo *FooArr[10]; void func() { FooArr arr; arr[0]-> // No completion } Task-number: QTCREATORBUG-12703 Change-Id: I1898dbf83eaa0a6dfa8c401390f28c78e5739bc4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | TextEditor: Consolidate document access functions.hjk2014-08-041-1/+1
| | | | | | | | | | | | | | | | There was document(), textDocument() and baseTextDocument(). Two should be enough... Change-Id: Id9e41c8d857c5cb3269a9fce5ab594d34448c982 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* | C++: nested class with enclosing template classPrzemyslaw Gorszkowski2014-08-011-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parent of instantiation of nested class of template class should be the instantiation of enclosing template class. To prevent the infinite loop for case with local typedef of enclosing template we should not change a parent of typedefed instatiation of enclosing template. Example: template <typename T> struct Enclosing { typedef Enclosing<T> EnclosingT;// first case struct Nested { typedef Enclosing<T> EnclosingT;// second case }; }; Task-number: QTCREATORBUG-11752 Task-number: QTCREATORBUG-11999 Change-Id: Iadd7b5ef73ee0c4881f59c9dabfe03339f55827b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: use pointer in template specialization and initializationPrzemyslaw Gorszkowski2014-07-311-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix code completion for using pointer in template specialization and initialization. Example: template <typename T> struct S {}; template <typename T> struct S<T*> { T* t; }; struct Foo { int foo; }; int main() { S<Foo*> s; s.t-> //no code completion return 0; } Task-number: QTCREATORBUG-12638 Change-Id: Idcd461806a22f08b76236f2db6346f157b12f5d3 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | TextEditor: Merge PlainTextEditor into Basehjk2014-07-301-1/+1
|/ | | | | | | | Same patter. Plain is fully merged now, so remove the files, too. Change-Id: Id8c0ba5689ad9980a0db3580cb9833344fd911f3 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* C++: template base class and default argument for template classPrzemyslaw Gorszkowski2014-07-081-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix code completion for case: struct Foo { int bar; }; template <typename T> struct Base { T t; }; template <typename T1 = Foo> struct Derived : Base<T1> {}; int main() { Derived<> foo; foo.t.// no code completion return 0; } Task-number: QTCREATORBUG-12606 Change-Id: Iadf2fae172739d0a5844c6b437fd2686616e64e7 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: base class and default argument for template classPrzemyslaw Gorszkowski2014-07-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | Fix code completion in case: struct Foo { int bar; }; template <typename T1 = Foo> struct Derived : T1 { }; int main() { Derived<> foo; foo. // members from Foo are not proposed return 0; } Task-number: QTCREATORBUG-12605 Change-Id: Ibe35c7b9a161e789057a4518c72390ac52489a3e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix include/framework path handling.Erik Verbruggen2014-07-041-1/+1
| | | | | | | | | | 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>
* C++: Fix completion for lambda parametersNikolai Kosjar2014-07-041-0/+5
| | | | | Change-Id: I6db51aeba328dbb69ec59082a70be7bc2d95699b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/3.1'Eike Ziller2014-06-131-0/+14
|\ | | | | | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs src/shared/qbs Change-Id: Iba59e41db72e2afdf594f1f7003215d7d8d1e6d3
| * 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>
* | Merge remote-tracking branch 'origin/3.1'Eike Ziller2014-04-141-0/+2
|\ \ | |/
| * 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>
* | Merge remote-tracking branch 'origin/3.1'Eike Ziller2014-04-081-0/+16
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs src/plugins/cpptools/cppcompletion_test.cpp Change-Id: Ic5e75b3ef164de664a1449ffa8579beaf5b02521
| * 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>
* | CppTools/Editor: Make sure test code is free of diagnostic messagesNikolai Kosjar2014-04-041-26/+14
| | | | | | | | | | | | | | | | ...where applicable. Change-Id: Ie42e1012598adf124e5f66b6a53eda01724dfb71 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | C++: fix typedef resolvingPrzemyslaw Gorszkowski2014-04-041-0/+24
|/ | | | | | | | | | | | | | | | | Fix a case: struct A { int a; }; typedef A B; typedef B* Bptr; Bptr b; b-> Task-number: QTCREATORBUG-10021 Change-Id: Ibf5ca801dbdb72744416924c0b8fc03daad5948a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>