summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/CppDocument.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CPlusPlus: Make (sub-)languague selection more generichjk2013-10-151-3/+7
| | | | | Change-Id: I4e2df6992b446adec662ab07671acd41715e41fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Rename "[Mm]ethod(s)" to "[Ff]unction(s)"Nikolai Kosjar2013-10-101-1/+1
| | | | | | | | | | | Only methods as programming functions are affected. Besides renaming some actions like "Switch Between Function Declaration/Definition" this mostly touches (api) code comments. This is a follow-up patch to commit 872bfb7. Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92 Reviewed-by: hjk <hjk121@nokiamail.com>
* C++: change working-copy to work on UTF-8 encoded QByteArrays.Erik Verbruggen2013-09-111-1/+2
| | | | | | | | | | | | These not only take less space than UTF-16 encoded QStrings, but due to the caching in the CppEditorSupport also take less time to build. This patch also fixes a number of possible encoding issues, where files and constant strings were (falsely) assumed to be UTF-8. Change-Id: Ib6f91c9a94ebed5b5dfbd4eb2998825c62c72784 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* CppTools: CppPreprocessor: Track also unresolved includesNikolai Kosjar2013-08-221-4/+9
| | | | | Change-Id: Ia36e7e7142dbc030a428369ed04e76e70e8eef0b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/2.8'Eike Ziller2013-06-251-2/+4
|\ | | | | | | | | | | | | Conflicts: src/plugins/fakevim/fakevimhandler.cpp Change-Id: I8101f18b87859924644471817d4f1408790d5628
| * Doc: use standard wording in \brief commandsLeena Miettinen2013-06-201-2/+4
| | | | | | | | | | | | | | | | | | QDoc does some magic with the \class and \namespaces and \brief commands, so the following wording must be used: "The xxx class yyy ..." Change-Id: Id231f30e8464898b776888d5423523de404aae34 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | C++: fix 'find usages' for templatesPrzemyslaw Gorszkowski2013-06-171-4/+5
|/ | | | | | | | | | | | | Fix find usages for template class(class name and template parameters) or template function(template parameters). Fixed: * marking * find usages * follow symbol Change-Id: I22fdbc11260cbd8ee9aafdd76aaeee0f4f49f9fd Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Record also unresolved paths for includesNikolai Kosjar2013-06-111-3/+3
| | | | | Change-Id: Id107b6c1f34f594c5a01502c156963c964235ed7 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: fix functionAt(), moved it, and added test.Erik Verbruggen2013-06-041-0/+51
| | | | | | | Thanks to Jesper K. Pedersen for the fix! Change-Id: Ie49c3352e26a9632b1500596b00d559bfe932dff Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix used template function parametersPrzemyslaw Gorszkowski2013-05-241-0/+8
| | | | | | | | | | | 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++: also refresh files not in the project when project changes.Erik Verbruggen2013-04-161-16/+26
| | | | | | | | | System headers and other file which are not explicitly mentioned in the project must be reparsed when the project changes. Task-number: QTCREATORBUG-9056 Change-Id: I32f1206d241a078a4d9b15fac5813f365a1ba303 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-16/+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>
* Fix Krazy warnings about duplicate includes.Friedemann Kleint2013-03-201-1/+0
| | | | | Change-Id: Ied32236a84d20225b1ca4a192f3a346fbfbd09b4 Reviewed-by: hjk <hjk121@nokiamail.com>
* C++: Cleanup, removed unused methods/fields.Erik Verbruggen2013-02-191-5/+0
| | | | | Change-Id: I5636039c79be40505c707f775b228bc51f35c243 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@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++: Introduce PointerDeclarationFormatterNikolai Kosjar2013-01-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | For a given AST, CppRefactoringFile and Overview this will create a ChangeSet for rewriting the pointer or reference declaration according to the Overview. Task-number: QTCREATORBUG-6169 Change-Id: If6f824c1ea5e9f53a11a58ec8b6d696d01f0723e Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Remove braces for single lines of conditionsOrgad Shaneh2013-01-081-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #!/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>
* | Further remove the number of QDir::cleanPath calls.hjk2012-12-201-1/+2
|/ | | | | Change-Id: I638fe4291d6b682864d0a0c3938ad0066e060a3a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix for missing includes in re-processed documents.Erik Verbruggen2012-10-151-0/+1
| | | | | Change-Id: I43b1d5b72c9bf7302e0acb9206c87152e4f0727b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix outdated macro usage info in documents.Erik Verbruggen2012-10-151-2/+11
| | | | | | | | | | | Record revisions of documents in macro definitions and usages. Then, when searching for usages, check the revision of the documents against the revision of the macros. If they are out-of-sync, repreprocess the documents to get up-to-date info. Task-number: QTCREATORBUG-7872 Change-Id: I846bb52ec660024728ab117a9fb7e43382a50e63 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* Adjust license headershjk2012-10-051-21/+20
| | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* rename QtDebug to QDebughjk2012-08-061-1/+1
| | | | | | | More uniform. Change-Id: I1c6057981f4c2b3170a4e69f0674fe4caf1143a2 Reviewed-by: Robert Loehning <robert.loehning@nokia.com>
* Contact -> qt-project.orgEike Ziller2012-07-191-3/+1
| | | | | Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* [C++] Rewrite of the preprocessor.Erik Verbruggen2012-03-291-2/+15
| | | | | | | | | | | | | 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>
* CppEditor: Fix go to definition of macros.Francois Ferrand2012-03-131-2/+2
| | | | | | | | | | | | | | | | | | - Go to macro definition only on macro name (ie not in parameters). - Prefer macro definition over expanded code definition, as the preprocessor is executed first: when trying to go to definition, the user sees the macro, not the expanded code. Task-number: QTCREATORBUG-2240 Task-number: QTCREATORBUG-6175 Task-number: QTCREATORBUG-6848 Task-number: QTCREATORBUG-7008 Task-number: QTCREATORBUG-7009 Change-Id: I819c763524e79b20518c26a46a99a3a3b0a131bd Reviewed-by: Andre Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
* Removed module names from #include directives.Erik Verbruggen2012-02-151-4/+4
| | | | | | | | Getting the #include directives ready for Qt5. This includes the new-project wizards. Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Long live the king!hjk2012-01-261-1/+1
| | | | | Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
* C++: Improve file accuracy when finding symbolsLeandro Melo2012-01-231-236/+0
| | | | | | | | | | | | | | | | | | | | | | 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-3/+3
| | | | | | | | Continuinng a previous commit... This is in order to make the interface clearer. Change-Id: Ic1b05217f878578bc84a064927507b75981c47d6 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* 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>
* C++: Fix findMatchingDeclaration for functions not in a class.Christian Kamm2011-10-311-3/+3
| | | | | | | | | That fixes navigation and the 'function signature update' quickfix for global functions and functions in namespaces. Task-number: QTCREATORBUG-6413 Change-Id: Ifc68a88a34eb363f4e84c72e9f72444d22df1086 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++: Fix bug in findMatchingDefinition.Christian Kamm2011-09-201-2/+4
| | | | | | | | In strict mode, don't give up after the first Document with candidates. Change-Id: I62ba59708a3501b31f79d979b1a85bede875eccb Reviewed-on: http://codereview.qt-project.org/5142 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* QmlJS: Find setContextProperty calls in C++ and expose to QML.Christian Kamm2011-09-081-1/+4
| | | | | | | | Task-number: QTCREATORBUG-3199 Change-Id: I591490ceafadc0f5a07c63ec063f1bdfa7055f47 Reviewed-on: http://codereview.qt-project.org/4074 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* QmlJS: Fix infinite loop when scanning for exported C++ types.Christian Kamm2011-08-311-0/+16
| | | | | | | | | | Setting extra diagnostics would call updateDocument which would in turn trigger another scan. Change-Id: I3810a380cdf716a12767d94ff82dc30f8ae3954d Reviewed-on: http://codereview.qt.nokia.com/3917 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++: Always remove NumericLiterals when removing the AST.Christian Kamm2011-08-251-7/+3
| | | | | | | | Contrary to StringLiterals, keeping them around is unnecessary. Change-Id: Idc1967c125e1373e69ce4c7640328d323a84ec14 Reviewed-on: http://codereview.qt.nokia.com/3395 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QmlJS: Move the exported-C++-type detection out of C++ code.Christian Kamm2011-08-241-245/+14
| | | | | | | | | | | | It now lives in qmljstools/qmljsfindexportedcpptypes, all in one place. Also ensures that the source code is available when a file is being scanned for QML exports. This will enable checking comments for annotations about the URI a plugin is usually imported as. Change-Id: I1da36d0678e0a8d34b171dbe0f6b5690d89eb18b Reviewed-on: http://codereview.qt.nokia.com/3392 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
* C++: Fix ::A name handling in findMatchingDeclaration.Christian Kamm2011-08-161-0/+2
| | | | | | | Change-Id: Id158be80c42056c145c2b787d4f569e2c0a0b66e Reviewed-on: http://codereview.qt.nokia.com/2932 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* C++: Synchronize function decl/def refactoring.Christian Kamm2011-08-161-4/+80
| | | | | | | | | | | When editing a function declaration or definition the code model may realize the same changes have to be applied somewhere else. A refactoring marker will pop up that can be clicked to perform the changes. Alternatively, press enter to apply. Change-Id: I2299a2ecfb6a8f87d4853fc7cfa99486f890a1d3 Reviewed-on: http://codereview.qt.nokia.com/2909 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* C++: Fix off-by-one in scopeAt.Christian Kamm2011-08-101-1/+1
| | | | | | | | | The only Scope that set the end offset to *before* the last token was ObjCClassDeclaration. Change-Id: Icbdb5bcdd72d96087ac586ad51510fed74a633eb Reviewed-on: http://codereview.qt.nokia.com/2820 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* Fix/add copyright headersTobias Hunger2011-05-061-1/+1
| | | | Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
* Update license.hjk2011-04-131-14/+13
|
* QmlJS: Disable possibly confusing warnings on qmlRegisterType.Christian Kamm2011-03-031-5/+8
| | | | | Reviewed-by: Roberto Raggi Reviewed-by: Erik Verbruggen
* It's 2011 now.con2011-01-121-1/+1
| | | | Reviewed-by: hjk
* C++/Qml: Don't allow exported types to override builtins.Christian Kamm2011-01-101-2/+2
| | | | | | | There was trouble when a plugin qmlRegisterType'd something like 'Item' into the global default module. Reviewed-by: Roberto Raggi
* Qml/C++: Allow dynamic uri in qmlRegisterType if fixed by Q_ASSERT.Christian Kamm2011-01-061-12/+134
| | | | Reviewed-by: Erik Verbruggen
* Qml-C++: Find C++ qmlRegisterType calls and populate QML code model.Christian Kamm2011-01-041-0/+116
| | | | Reviewed-by: Erik Verbruggen
* Merge branch '2.1'con2010-12-171-7/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/coreplugin/basemode.cpp src/plugins/coreplugin/basemode.h src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h src/plugins/debugger/cdb/cdbsymbolpathlisteditor.cpp src/plugins/debugger/debuggeragents.cpp src/plugins/debugger/debuggeruiswitcher.cpp src/plugins/debugger/debuggeruiswitcher.h src/plugins/projectexplorer/buildconfigdialog.cpp src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp src/plugins/qmldesigner/components/propertyeditor/colorwidget.h src/plugins/qmldesigner/designercore/include/enumeratormetainfo.h src/plugins/qmldesigner/designercore/include/modelutilities.h src/plugins/qmldesigner/designercore/include/nodeinstance.h src/plugins/qmldesigner/designercore/include/propertymetainfo.h src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.cpp src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.h src/plugins/qmldesigner/designercore/instances/graphicsviewnodeinstance.cpp src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.cpp src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.h src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp src/plugins/qmldesigner/designercore/instances/qmlviewnodeinstance.cpp src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.cpp src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.h src/plugins/qmldesigner/designercore/metainfo/enumeratormetainfo.cpp src/plugins/qmldesigner/designercore/metainfo/propertymetainfo.cpp src/plugins/qmldesigner/designercore/model/modelutilities.cpp src/plugins/snippets/inputwidget.cpp src/plugins/snippets/snippetscompletion.cpp src/plugins/snippets/snippetscompletion.h src/plugins/snippets/snippetspec.cpp src/plugins/snippets/snippetsplugin.cpp src/plugins/snippets/snippetswindow.cpp src/plugins/snippets/snippetswindow.h src/plugins/texteditor/snippetsparser.cpp src/tools/qml/qmldom/main.cpp tests/manual/trk/runner.cpp tests/manual/trk/trkolddevice.cpp tests/manual/trk/trkolddevice.h tests/manual/trk/trkserver.cpp
| * License headers.con2010-12-171-7/+11
| |
* | Added some initial support for function overloading.Roberto Raggi2010-12-101-2/+4
| |