summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Utils: Cleanup of Tooltip interfacehjk2013-09-131-5/+4
| | | | | Change-Id: If4908e7a5d5ce749ff1e2efc7a026604821737be Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* Fix coding style for else statementsOrgad Shaneh2013-07-171-10/+5
| | | | | Change-Id: I1309db70e98d678e150388c76ce665e988fdf081 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Merge branch '2.7'Oswald Buddenhagen2013-05-151-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/qtquick/qtquick-components.qdoc doc/src/qtquick/qtquick-designer.qdoc qtcreator.pri qtcreator.qbs src/plugins/cppeditor/cppinsertdecldef.cpp src/plugins/qnx/qnxruncontrolfactory.cpp Change-Id: I0a37a07c42719bc0d9ef5b3ac4641d01a63c0d88
| * C++: Fix crash in code completion.Erik Verbruggen2013-05-031-2/+2
| | | | | | | | | | | | | | | | | | | | Caused by a dangling pointer of a template instantiation which had been cloned into the wrong control. The fix is to remove that control and refer to the control of the bindings (which is the correct one). Change-Id: I951a60f2e613aae1e4ac901ce99c820212018709 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppEditor: Rearrange quick fix filesLorenz Haas2013-04-151-36/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Moved content of cppinsertdecldef.(cpp|h) cppcompleteswitch.(cpp|h) cppinsertqtpropertymembers.(cpp|h) and ApplyDeclDefLinkChanges to cppquickfixes.(cpp|h). Made msgQtStringLiteralDescription private member function of WrapStringLiteral, added anonymous namespace, "extracted" useful functions to the top of cppquickfixes.cpp. Change-Id: I4f82a005a62be3c29d4b96902667bd3a2b9397cc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Clean headers in CppEditor.Friedemann Kleint2013-04-101-8/+0
| | | | | | | | | | | | | | | | Ran script to remove inludes on a trial-and-error basis and manually corrected it. Change-Id: I61a5c2fff02616f6883ddf3923e4361fca6bf92b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-14/+16
| | | | | | | | | | | | | | | | | | | | | | ... 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>
* | C++: use argumentCount in loops in initializer.Erik Verbruggen2013-03-151-3/+3
|/ | | | | | | | argumentCount is a more expensive function, so try to call it only once, esp. in loops. Change-Id: I6f0d420352743ec444487ce3f506ef28e5282d1e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Editor: Add further Use::isInvalid() guardsNikolai Kosjar2013-02-191-0/+2
| | | | | | | | Task-number: QTCREATORBUG-8738 Change-Id: I297731f15bd9001f7edc83c956a15ef660929dc7 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/2.6'Oswald Buddenhagen2013-01-311-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/debugger/qtmessageloghandler.cpp src/plugins/debugger/qtmessagelogwindow.cpp src/plugins/madde/maemodeployconfigurationwidget.cpp src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp src/plugins/qmldesigner/designercore/include/widgetqueryview.h src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp src/plugins/qnx/bardescriptormagicmatcher.h src/plugins/qt4projectmanager/profilekeywords.cpp src/plugins/remotelinux/deployablefilesperprofile.cpp src/plugins/remotelinux/deployablefilesperprofile.h src/plugins/remotelinux/deploymentinfo.cpp src/plugins/remotelinux/deploymentsettingsassistant.cpp src/plugins/remotelinux/profilesupdatedialog.cpp tests/auto/icheckbuild/ichecklib.cpp tests/auto/icheckbuild/parsemanager.cpp tests/auto/icheckbuild/parsemanager.h Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
| * Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | | | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | C++: Add settings dialog for pointer declaration formattingNikolai Kosjar2013-01-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dialog is at Tools > Options > C++ > Code Style > Edit... > Pointers and References. Currently the settings are referenced when applying the following QuickFixes: - Adapting function signature in declaration/definition (FunctionDeclDefLink) - Inserting declaration from definition (InsertDeclOperation) - Inserting definition from declaration (InsertDefOperation) - Extracting a function (ExtractFunctionOperation) - Add Local Declaration (AddLocalDeclarationOp::Operation) In these cases the code style of the current project is used. If there is no current project open, the current global code style is used. Task-number: QTCREATORBUG-6169 Change-Id: I3e4e502b3103f7f754ac9b39594ad461d89d9304 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Move TextEditor::ToolTip to UtilsDaniel Teske2013-01-111-4/+4
| | | | | | | | | | | | | | To enabled reuse from all plugins. Change-Id: I1de68c8e6ed017d45f1248b2043f9611becc3b54 Reviewed-by: David Schulz <david.schulz@digia.com>
* | Remove braces for single lines of conditionsOrgad Shaneh2013-01-081-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #!/usr/bin/env ruby Dir.glob('**/*.cpp') { |file| # skip ast (excluding paste, astpath, and canv'ast'imer) next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i s = File.read(file) next if s.include?('qlalr') orig = s.dup s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m| res = $& if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces res else res.gsub!('} else', 'else') res.gsub!(/\n +} *\n/m, "\n") res.gsub(/ *{$/, '') end } s.gsub!(/ *$/, '') File.open(file, 'wb').write(s) if s != orig } Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc Reviewed-by: hjk <qthjk@ovi.com>
* | cppquickfixes: compile fix for msvc2008hjk2012-11-081-0/+1
| | | | | | | | | | Change-Id: I287c76372d2c50c408b9ef74e292a36d8e278449 Reviewed-by: hjk <qthjk@ovi.com>
* | CppEditor: simplify CppQuickFixOperation interfacehjk2012-11-071-14/+7
| | | | | | | | | | Change-Id: Ib3ed82c7f07f80027b18471ffb7b3055fa74eb52 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppEditor: remove operator() overloads from OverViewhjk2012-10-171-9/+9
| | | | | | | | | | | | | | Feels less obfuscated. Change-Id: Ide0ec1f38762038ddbb1eddb4f70f7d6acdf1ff7 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Cpp: No need for accessors for simple structshjk2012-10-111-4/+4
| | | | | | | | | | Change-Id: Ie09c1fc59dd54d2302a78cfc9769d5cda6012be7 Reviewed-by: hjk <qthjk@ovi.com>
* | Merge remote-tracking branch 'origin/2.6'Eike Ziller2012-10-051-21/+20
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.cpp share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h src/plugins/debugger/qtmessageloghandler.cpp src/plugins/debugger/qtmessageloghandler.h src/plugins/debugger/qtmessagelogwindow.cpp src/plugins/madde/maemodeployconfigurationwidget.cpp src/plugins/madde/maemodeployconfigurationwidget.h src/plugins/remotelinux/deployablefilesperprofile.cpp src/plugins/remotelinux/deployablefilesperprofile.h src/plugins/remotelinux/deploymentinfo.cpp src/plugins/remotelinux/deploymentinfo.h src/plugins/remotelinux/deploymentsettingsassistant.cpp src/plugins/remotelinux/profilesupdatedialog.cpp src/plugins/remotelinux/remotelinuxdeploymentdatamodel.h tests/auto/icheckbuild/ichecklib.cpp tests/auto/icheckbuild/ichecklib_global.h tests/auto/icheckbuild/parsemanager.cpp tests/auto/icheckbuild/parsemanager.h tests/manual/ssh/tunnel/tunnel.h Change-Id: I04d7761df6bd936ad00e0547974284c967d39580
| * Adjust license headershjk2012-10-051-21/+20
| | | | | | | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | Do not use the fromAscii() and toAscii() functions.Christian Kandeler2012-09-211-1/+1
|/ | | | | | | | | | They are deprecated in Qt 5. Use fromLatin1() and toLatin1() instead. In Qt 5, these always do the same thing as their "Ascii" counterparts. The same goes for Qt 4, provided QTextCodec::setCodecForCStrings has not been set, which it hasn't. Change-Id: I04edeb376762b6671eff8156094f0d5e2cb8e1ea Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Contact -> qt-project.orgEike Ziller2012-07-191-3/+1
| | | | | Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* C++: Introduce unicode char/strings supportLeandro Melo2012-06-061-0/+2
| | | | | | | | | | | | | | Those are the types char16_t and char32_t along with the new char/string literals u'', U'', u"", u8"", and U"". This is particularly important for the use of QStringLiteral since in some platforms it relies on expansion such as above. Note: The string literals quickfixes still need some tunning. Task-number: QTCREATORBUG-7449 Change-Id: Iebcfea15677dc8e0ebb6143def89a5477e1be7d4 Reviewed-by: hjk <qthjk@ovi.com>
* ActionManager API cleanup.Eike Ziller2012-05-251-2/+1
| | | | | | | | d-pointer instead of inheritance static methods Change-Id: I7b2f0c8b05ad3951e1ff26a7d4e08e195d2dd258 Reviewed-by: hjk <qthjk@ovi.com>
* QuickFixes: Fix capitalization of descriptionsKai Koehne2012-05-101-1/+1
| | | | | | | | Always use camel case for actions in context menu. Change-Id: Iafa0569c4bca4ecb858fe618780208322379b979 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com>
* Merge remote-tracking branch 'origin/2.5'Eike Ziller2012-04-271-0/+1
|\ | | | | | | | | | | | | | | Conflicts: doc/templates/style/style.css qtcreator.pri Change-Id: I5f4f5f191726883dae18cb760733a5e8e6bd4e7d
| * Editor: Fix null-pointer dereferenceDavid Schulz2012-04-271-0/+1
| | | | | | | | | | | | Task-number: QTCREATORBUG-7330 Change-Id: I5c76e5ce4e3ab7f0659a7df82301b853a9983da1 Reviewed-by: hjk <qthjk@ovi.com>
* | [C++] Rewrite of the preprocessor.Erik Verbruggen2012-03-291-1/+1
|/ | | | | | | | | | | | | This rewrite fixes a couple of issues with the pre-processor. It now supports: - macros in macro bodies - stringification of parameters [cpp.stringize] - the concatenation operator [cpp.concat] - #include MACRO_HERE - defined() inside macro bodies used in pp-conditions. Change-Id: Ifdb78041fb6afadf44f939a4bd66ce2832b8601f Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Editor: Fix NULL-Pointer dereference in cppfunctiondecldeflinkDavid Schulz2012-03-161-2/+5
| | | | | | | | Happen when trying to synchronize a return type in an inapropriate AST. Task-number:QTCREATORBUG-7073 Change-Id: I6621a3d5539f96c0db9e0d20423dba9a7def98fc Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* Removed module names from #include directives.Erik Verbruggen2012-02-151-2/+2
| | | | | | | | Getting the #include directives ready for Qt5. This includes the new-project wizards. Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* C++: Moved completion/highlighting into the model manager.Erik Verbruggen2012-02-081-1/+2
| | | | | | | | | | This way the editor does not need to know all the details of instantiating or maintaining classes for highlighting and/or completion, it can just ask the model manager. The change also enables different highlighting- or completion-engines without changes to the cppeditor. Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* Long live the king!hjk2012-01-261-1/+1
| | | | | Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
* Use new static ICore interface.hjk2012-01-241-1/+1
| | | | | Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
* C++: Fix "reference" file in symbol finderLeandro Melo2012-01-231-3/+1
| | | | | | | | | | Througout the initial review the singleton was transformed into an ordinary class, but a error was introduced: The "reference" file was incorrectly assumed to be the editors file, which is wrong, since it should be the declaration file. Change-Id: Iad3e25a690fa8bd07a18184b24b10f8dea965332 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Improve file accuracy when finding symbolsLeandro Melo2012-01-231-4/+8
| | | | | | | | | | | | | | | | | | | | | | This patch introduces a priority-based mechanism when searching for certains symbols in the snapshot. The priority corresponds to how similar the file path from the "reference" symbol is to the file path from the "candidate" symbol. This solves a variety of issues when matching "equivalent" symbols but that are in another file/project, such as when following a function declaration, a forward class declaration, or adding a definition through a quickfix. There's now a symbol finder which will compute the "best" search order and cache the most recent results. A consequence is that following symbols in some cases is slower, but not apparently significatly. Note: The "find" functions were moved from the Snapshot to the new SymbolFinder class. Task-number: QTCREATORBUG-6697 Task-number: QTCREATORBUG-6792 Change-Id: Ia518f014275fec1f4d0cb3224bd4e06a9df6d557 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Rename source/setSource to utf8Source/setUtf8SourceLeandro Melo2012-01-131-2/+2
| | | | | | | | Continuinng a previous commit... This is in order to make the interface clearer. Change-Id: Ic1b05217f878578bc84a064927507b75981c47d6 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Accept UTF-8 byte arrays in type of expressionLeandro Melo2012-01-131-1/+2
| | | | | | | | | | | The model uses UTF-8 internally and it makes more sense to only convert when necessary. A following commit will rename the source/setSource methods in document for more clarity too. Change-Id: I960ea0754efabd1436ad4b4299a57faeb65a8bee Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* CppEditor: Compile with QT_NO_CAST_FROM_ASCII.Friedemann Kleint2012-01-121-1/+1
| | | | | | | | - Avoid unnecessary conversions - Add missing tr(). Change-Id: I3c0dd627a3621929c9c6fc71db6924fa513e34a7 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* C++ function signature: Preserve trailing non-cv specifiers.Christian Kamm2011-11-281-14/+36
| | | | | | | | Like __attribute__((...)). Task-number: QTCREATORBUG-6620 Change-Id: I8cf9f1743cf107a9ef858206de138ca9771bbdf0 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* C++ function signature: Avoid hitting a QTC_ASSERT.Christian Kamm2011-11-231-4/+6
| | | | | Change-Id: I0390e51a7d1fc4563eed791c9f8c8ed403398663 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* Compile fix for use of QVarLengthArrayLeandro Melo2011-11-211-5/+8
| | | | | Change-Id: Ia68a121f61aab3667d1a4c99ba348fbfe2e98d4d Reviewed-by: Bill King <bill.king@nokia.com>
* C++ function signature: Automatically rename argument uses in body.Christian Kamm2011-11-211-0/+25
| | | | | | Task-number: QTCREATORBUG-6132 Change-Id: I7c21e648cfc2e85803a3bf4df0a615a1e276f96a Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* C++ function signature: Improve preserving of default arguments.Christian Kamm2011-11-211-100/+289
| | | | | | Task-number: QTCREATORBUG-5978 Change-Id: Iab0bba3c16b4cd435f0dc6339db49f209f1359d3 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* Merge remote-tracking branch 'origin/2.4'Eike Ziller2011-11-111-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/qmljs/qmljsinterpreter.cpp src/libs/qmljs/qmljsinterpreter.h src/plugins/debugger/qml/scriptconsole.cpp src/plugins/git/gitplugin.cpp src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
| * all: s/info@qt.nokia.com/qt-info@nokia.com/hjk2011-11-031-2/+2
| | | | | | | | | | Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* | QuickFixes: Sort by priority.Christian Kamm2011-11-041-4/+2
|/ | | | | | | | | | | * Generally changes the BasicProposalItemListModel's sort to take the BasicProposalItem::order member into account. * Currently only the QML completion and quick fixes set the order. * This means the 'Apply signature changes' quick fix is now further up than the 'add definition' quick fix. Change-Id: I7b5bc82aa37fca232fddd630ab3273437e1bcc09 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* C++: Improve calculation of function argument count.Christian Kamm2011-10-211-3/+3
| | | | | | | Reuse Function::argumentCount instead of reimplementing it. Change-Id: I05ba2dbee087e5dfd53c7af3ec94d214f6e37a54 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++ function signature: Abort on unexpected function name.Christian Kamm2011-09-261-3/+10
| | | | | | Change-Id: Iaaa3907f709ea9ed567f59725399efd9024f3bc0 Reviewed-on: http://codereview.qt-project.org/5319 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++ function signature: Don't try to reuse nonexistant context.Christian Kamm2011-09-141-1/+1
| | | | | | Change-Id: I890cccc25c5ba774691edee860845e22a7b7ec78 Reviewed-on: http://codereview.qt-project.org/4876 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++ function signature: Add shortcut to marker tooltip.Christian Kamm2011-09-131-0/+10
| | | | | | Change-Id: Ied3268bb624df4201ca42beb76d20b9a638d5918 Reviewed-on: http://codereview.qt-project.org/4746 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>