summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppfindreferences.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * License updateEike Ziller2014-10-091-7/+8
| | | | | | | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | CppTools: Change CppModelManager implementation patternhjk2014-09-191-3/+3
| | | | | | | | | | | | | | | | | | Replace the CppModelManagerInterface/derived CppModelManager combo by a more common CppModelManager/CppModelManagerPrivate pimpl pattern. Change-Id: Ia4582845ed94d5ef60b8571bab9b2260c6290287 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | CppTools: Move DependencyTable to Snapshothjk2014-09-191-44/+4
| | | | | | | | | | | | | | | | It logically depends on the Snapshot and has a related lifetime. Keeping it in the Snapshot avoids some code compelxity. Change-Id: I24ee4483b44d9b0d7f2e4d494ae7ea624b949f9c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: Change QStringList to QSet<QString> to prevent conversions.Erik Verbruggen2014-09-041-1/+1
| | | | | | | | | | | | | | | | | | This eliminates a bunch of list->set->list conversions. Especially the ProjectInfo::appendProjectPart takes lots of time converting for every part added. Change-Id: Ib3c8cd4b0ad6c012ccbeed12ebedd46b9b6cca95 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
* | CppTools: Move WorkingCopy to new cppworkingcopy.{h,cpp}Nikolai Kosjar2014-08-201-9/+10
|/ | | | | Change-Id: I447acf28849bffb52c1e6b6eafdde221ec0b179e Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Add utf16 indices to Macro and Document::MacroUseNikolai Kosjar2014-05-231-21/+28
| | | | | | | | | In most cases we need to work with the utf16 indices. Only in cppfindreferences the byte interface is still needed since there we read in files and work on a QByteArray to save memory. Change-Id: I6ef6a93fc1875a8c9a305c075d51a9ca034c41bb Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Cpp{Tools,Editor}: Expect UTF-8 encoded literalsNikolai Kosjar2014-05-231-1/+1
| | | | | Change-Id: I9843c4163aad3fa3f1bfa33060c76328fc2dc25a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Use more descriptive progress bar titlesEike Ziller2014-04-281-2/+2
| | | | | | | Change-Id: I70450a2aa675d69f820de48dd75909f36051efe0 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* CppTools/QmlJSEditor: Hide "Preserve Case" for Replace Symbol Under CursorNikolai Kosjar2014-03-121-0/+2
| | | | | | | | | ...since it does not make sense for symbols. Task-number: QTCREATORBUG-11669 Change-Id: Ic249cb15cdb3b324a9b215323acd802a33797100 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* Core: Merge Find and Locator into Core pluginhjk2014-01-141-26/+26
| | | | | | | Change-Id: I7053310272235d854c9f409670ff52a10a7add8b Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* 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>
* Revert "C++: Fix highlighting for lines with predefined macros"Nikolai Kosjar2013-12-031-2/+0
| | | | | | | | | | | | | | | | | | This takes too much memory. For qtcreator.pro the numbers are as follows: Patch applied: ~ 1600MB (RES) Patch reverted: ~ 510MB (RES) This reverts commit 4c2daa90ce558c3b4287edc97127471486a411d9. Task-number: QTCREATORBUG-10973 Change-Id: I843bd7c1ea4a26a1ec55ddc14c2a34a98d040922 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix highlighting for lines with predefined macrosNikolai Kosjar2013-11-291-0/+2
| | | | | | | | | | | | | | This adds definitions for the macros __FILE__, __LINE__, __DATE__ and __TIME__ on demand. As a side effect, this also introduces highlighting for the uses of these macros. Task-number: QTCREATORBUG-8036 Change-Id: Ib7546c7d45d2eecbc50c7883fc684e3497154405 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* C++: Release more documents.Erik Verbruggen2013-11-121-6/+15
| | | | | | | | | | | | | | | | | | | | - fix memory leak in find-usages - do not retain snapshot in search history - when an editor is invisible for more than 2 minutes, release the backing snapshot Retaining snapshots will retain their documents, and if done for too long, the memory consumption might grow. This is especially the case when switching to a different kit (Qt version): in that case, the new versions of headers will be indexed, while the old ones stay around. Task-number: QTCREATORBUG-5583 Task-number: QTCREATORBUG-7645 Task-number: QTCREATORBUG-9842 Change-Id: I045eda1565e0a3fa702baeffaab9c12662f90289 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Avoid holding on lots of data with C++ Find UsagesEike Ziller2013-10-181-107/+111
| | | | | | | | | | The snapshots at the moment of search were held as long as the corresponding search result panel was kept, to allow mapping of the old symbol to the corresponding symbol in the new snapshot. Now we just save the file name and ID of the old symbol. Change-Id: Iaf3c9ca27ec2b788f142bd0dd6b86e34e66d5c8b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: change working-copy to work on UTF-8 encoded QByteArrays.Erik Verbruggen2013-09-111-17/+18
| | | | | | | | | | | | 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>
* ProjectManager: Use Core::Id for progress typeshjk2013-09-041-2/+2
| | | | | Change-Id: I72993fda50ad70ad2d7c2f449923ac6e34b9e737 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* Core: Static pattern for ProgressManager, clean up all usershjk2013-09-021-9/+8
| | | | | Change-Id: I4af8793ca69a3af9e99baeb7c31dad3864266f91 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* EditorManager: Use static pattern, adjust surrounding codehjk2013-08-301-1/+1
| | | | | Change-Id: I3255a0150cd9a730336456c5a9f986eb74fefbff Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* CppTools: Fix "! condition" coding styleNikolai Kosjar2013-07-251-3/+6
| | | | | | Change-Id: Ic7e634e4249fb64edbc2daceb65ec8e9b5f0f8b9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
* Switch less often to edit modeEike Ziller2013-06-051-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This change * Removes IMode::type, ModeManager::activateModeType, and IEditor::preferredModeType, and adds IEditor::isDesignModePreferred instead * Adapts the mode switching code in EditorManager to handle multiple windows, for example switching to edit mode should only happen if the editor/view is in the main window. Otherwise the editor window should be raised and focused * Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor * Reverts the EditorManager::ModeSwitch logic to switch mode or make the current editor visible by default, introducing DoNotMakeVisible flag instead * Fixes a few instances where EditorManager::ModeSwitch should have been used One non-trivial problem left: If you open a .ui file and switch to an external editor window, edit mode is activated, because the current editor no longer is a .ui file, which means that the design mode gets deactivated. Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41 Reviewed-by: David Schulz <david.schulz@digia.com>
* Move openEditorAt from BaseTextEditorWidget to EditorManagerEike Ziller2013-06-031-5/+5
| | | | | | | More sensible place, gotoLine is a method in IEditor anyhow. Change-Id: I420a6bf17060c16e6f1a4f45e0bef89379fb6bf8 Reviewed-by: David Schulz <david.schulz@digia.com>
* CppTools: Rename files to comply with coding standardTobias Hunger2013-04-101-1/+1
| | | | | | | | Rename ModelManagerInterface.(h|cpp) to cppmodelmanagerinterface.(h|cpp). Rename TypeHierarchyBuilder.(h|cpp) to typehierarchybuilder.(h|cpp). Change-Id: I035d833fd205d7460819bd0fb7031294359032f9 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Clean headers in CppTools.Friedemann Kleint2013-04-101-21/+0
| | | | | | | | Ran script to remove inludes on a trial-and-error basis and manually corrected it. Change-Id: Ic8464ea084ca1ab401e9f4a7d0183b92b4038902 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Use namespace CppTools consistentlyTobias Hunger2013-04-081-0/+1
| | | | | | | | | There were quite a few classes using CPlusPlus namespace in the CppTools plugin. Rename them and do some other small namespace related coding style fixups. Change-Id: I093fc1f3fc394fd9923e3f18d5f66522e288f21d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-20/+21
| | | | | | | | | | | ... 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++: fix find/rename macro usages.Erik Verbruggen2013-02-011-4/+5
| | | | | | | | The replace button was not connected. Also made the search restarting slightly more robust. Change-Id: Iad7aea436749c0bda6ec4f58776e73b598a12a23 Reviewed-by: Christian Stenger <christian.stenger@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>
* | Remove braces for single lines of conditionsOrgad Shaneh2013-01-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #!/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>
* | Support preserving case when replacing.Francois Ferrand2012-12-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When making a case insensitive search, try to keep the string capitalization when doing the replace: - All upper-case matches are replaced with the upper-case new text. - All lower-case matches are replaced with the lower-case new text. - Capitalized matches are replace with the capitalized new text. - Other matches are replaced with the new text as provided. Note: this does not work with regexp replace, only plain text. Change-Id: I87cbc28eb64688bdf3c8c6ec173fcb22f91abcd0 Reviewed-by: Cristian Tibirna <tibirna@kde.org> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | CppTools: Compile with QT_NO_CAST_FROM_ASCIIOrgad Shaneh2012-11-221-7/+7
| | | | | | | | | | Change-Id: I31a6117c2b4be3f8603c16a9f98b6937a0b9aeb2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | C++ Macro Usages: RefactoringAndre Hartmann2012-10-241-10/+9
| | | | | | | | | | Change-Id: I959e0aeeec3164fdd997c08b6d4ed4e95a39009f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppEditor: remove operator() overloads from OverViewhjk2012-10-171-1/+1
|/ | | | | | | Feels less obfuscated. Change-Id: Ide0ec1f38762038ddbb1eddb4f70f7d6acdf1ff7 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: removed invalid FIXME.Erik Verbruggen2012-10-151-1/+0
| | | | | Change-Id: I05d17e5384bcc75e97c5d901b65a582516a5d321 Reviewed-by: David Schulz <david.schulz@digia.com>
* C++: Fix outdated macro usage info in documents.Erik Verbruggen2012-10-151-13/+18
| | | | | | | | | | | 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>
* C++ Macro Usages: Fix search result encoding and highlighting.Andre Hartmann2012-10-151-28/+13
| | | | | | | | | | | | | If the result lines contain non-Latin1 characters (e.g. in comments), the output is garbled. Using QByteArrays with toUtf8() and fromUtf8() doesn't seem to be an alternative, as in this case the macro.offset() is no longer valid. So it seems to be the best to use QString for the result lines. Task-number: QTCREATORBUG-7122 Change-Id: I57128c9c9f3eb182f079e305e97e9c5ac0a1bc61 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Adjust license headershjk2012-10-051-21/+20
| | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* "Find Usages" and "Refactor" may decode error.raidsan2012-10-051-5/+11
| | | | | | | | Task-number: QTCREATORBUG-7204 Change-Id: I6ce82c701246ddac9cadcdd22ef994b0086ce8f7 Reviewed-by: Andre Hartmann <aha_1980@gmx.de> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Make IOutputPane behaviour more granularDaniel Teske2012-09-131-2/+2
| | | | | | | | | The commit looks big, but it's mostly trivial. Also any build/run related popups are now "flashes" if the current mode has no placeholder. Task-number: QTCREATORBUG-7875 Change-Id: I3af40557f7af01798f905c0d1829423c80058cb6 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Contact -> qt-project.orgEike Ziller2012-07-191-3/+1
| | | | | Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Implemented Rename Macro UsagesAndre Hartmann2012-06-061-1/+18
| | | | | | | | | | | Works the same way as Rename Usages for C++ Symbols. For now, no Search Again as this requieres further work. Task-number: QTCREATORBUG-413 Change-Id: I09e85ea1e8c247f5ce0b6bc566aba8018c1569e4 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
* Show warning with continue/cancel in case of many search resultsEike Ziller2012-06-051-2/+22
| | | | | | | Task-number: QTCREATORBUG-6116 Change-Id: I57a66b8989f1cc4137b02df370704dfe43d392ac Reviewed-by: Robert Löhning <robert.loehning@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Mark canceled searches as such.Eike Ziller2012-05-221-3/+3
| | | | | | | | Task-number: QTCREATORBUG-6820 Change-Id: Ic14c0ea6f26e4a05c642012b87578f30c817fef7 Reviewed-by: Robert Löhning <robert.loehning@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* editormanager: simplify use of interfacehjk2012-05-111-2/+2
| | | | | | | Less code on the user side, same meaning. Change-Id: I14e54a5d2ed8e024a51cce74eaf7c8419ad544be Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Fix C++ Macro Usages definition line in Search Results.Andre Hartmann2012-04-041-7/+6
| | | | | | | | | | | | | Add the complete line to the Search Results window, including '#', "define", macro and macro value and all possible white spaces between them. Also covers the case of line continuation in macro definitions from commit 3dec48557a2b9ff64237d2aa4077c65a62c6af42. Task-number: QTCREATORBUG-7217 Change-Id: I8b9d0c23d31ef76244833a9b9d67469c5c4a5635 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix C++ Macro Usages when Definition contains Newline.Andre Hartmann2012-03-291-2/+7
| | | | | | | | | | | Now truncates the displayed line at the first Newline character after the Macro name. Task-number: QTCREATORBUG-7113 Change-Id: Ifb13c01d10b97098b54ac4346a80f0dcff3a35f3 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
* Merge remote-tracking branch 'origin/2.5'Eike Ziller2012-03-281-4/+6
|\
| * Don't pass native file names to internal API.Eike Ziller2012-03-271-4/+6
| | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-7191 Change-Id: I89889a3580f4a27a912eacb09e893b428c5c5351 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* | Improved highlighting in C++ Macro Usages.Andre Hartmann2012-03-161-3/+4
| | | | | | | | | | | | | | | | | | | | Only highlight the Macro name, not the whole definition line or the parameter list in function-like Macros. Change-Id: I5732dd5dd18cee150755ea35a5fbb67fdaed51c4 Reviewed-by: Francois Ferrand <thetypz@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Leandro Melo <leandro.melo@nokia.com>