summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/MatchingText.cpp
Commit message (Collapse)AuthorAgeFilesLines
* C++: Do not insert matching } within stringNikolai Kosjar2017-08-071-0/+5
| | | | | | | | | | | Regression from commit a6aa287720112c70c1363bcb46d55d438fe57eac C++: Fine-tune auto insertion of '}' Change-Id: I3ede8c7a1e3c73708d5d5a59c314e4b4596976b2 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* C++: Fine-tune auto insertion of '}'Nikolai Kosjar2017-07-211-21/+204
| | | | | | | | | | | | | | Do not insert for these cases: * <Cursor>{ * namespace X <Cursor> * if the next block is indented, like e.g.: if (e) <Cursor> g(); * on empty line if text before looks like a finished statement or scope opening/end Change-Id: Id9decc1e964a775724a929c2a3e79b5283105560 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Avoid auto insertion of '}' in empty lineNikolai Kosjar2017-07-171-1/+5
| | | | | | | ...when typing '{'. Change-Id: Ia1d3bcd7440c96ed3c8c1479148dd74d3d291689 Reviewed-by: David Schulz <david.schulz@qt.io>
* C++: Handle curly braces like other brace typesNikolai Kosjar2017-05-231-8/+4
| | | | | | | | | | | | | | | | Unless it balances the curly braces * typing '{' leads to auto insertion of '}'. * typing '}' skips already present '}'. * removing '{' leads to auto removal of '}'. This prevents unbalanced curly braces, which are problematic for clang. Concrete use cases are: typing of initializer lists, lambdas, function definitions. Task-number: QTCREATORBUG-15073 Change-Id: Iec8c6aa5aca054455c1e1bfde3a65c4fd1f579c3 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* Use const'ref in theses methodsMontel Laurent2017-04-211-1/+1
| | | | | Change-Id: Idfa5ffdcf23d1ef80442276690b8082b8279dbfa Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove spaces in initializer listsTim Jenssen2017-02-221-1/+1
| | | | | | | Format initializer lists code style like. Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013 Reviewed-by: hjk <hjk@qt.io>
* C++: Do not add double quotes when splitting raw string litteralsDavid Schulz2017-02-221-4/+4
| | | | | | Task-number: QTCREATORBUG-17717 Change-Id: Iffb34a3d77ada624dc13b8ab050ac08731d25863 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: Fix handling of Objective-C/C++Francois Ferrand2016-12-051-0/+1
| | | | | | | | | | | - Objective C/C++ was not enabled in highlighter. - QMake project part for Objective C/C++ did not have ObjectiveC extension enabled. - As languageFeatures.objCEnabled is a bitfield, it was actually always set to 0. - Highlight ObjC class & protocol declarations. - Highlight ObjC message passing. Change-Id: I64d12c9509058d05f7adce94598cb7ce91727ac8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: Disable C++ keywords in C filesFrancois Ferrand2016-08-231-0/+1
| | | | | | | | | | | | In some (legacy) C files, new and delete may be used for regular identifier. There are some limitations: * Header files have no 'implicit' type, and may be parsed as C++ or ObjC depending on the other files in the project. * QMakeProject use a single ProjectPart for C and C++ files, so there will still be the issue. Change-Id: Iec11687b35f7ccf1e7c0d091b143ae90d950e440 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Editor: Skip auto completed character only if it was recently inserted.David Schulz2016-06-211-8/+10
| | | | | | | | | | | | | | | | This means you can skip automatically inserted characters as long as you don't explicitly move the text cursor and the editor doesn't lose the focus. This will be visualized by highlighting the automatically inserted character as long as you can perform the skipping. This will reduce unexpected skipping in the case a cursor was explicitly placed before an closing brace and a closing brace is typed. Change-Id: I28e29e79ba10c9c48e8bc8817405fea630cca9bd Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* CPP: Remove unused function.David Schulz2016-05-261-13/+0
| | | | | | Change-Id: Ib55fd0c059b2e5e117250eb4671b3352ab41b310 Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* C++: Improve automatic quoting magic.David Schulz2016-05-251-3/+16
| | | | | Change-Id: I5d3a15dc100ae9c03bbc49de99714da1c89cb0d8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Editor: Separate auto insert brace and quote magic.David Schulz2016-05-251-23/+49
| | | | | | | To allow enabling/disabling both features separately. Change-Id: Ica154e3b400823de7cf22daf006958802d751c64 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: optimize paragraph insertion.David Schulz2016-05-201-12/+2
| | | | | | | | | | Do not check tokens which are returning the default return value. Do not check for tokens when a previous condition excludes the other token types. Change-Id: Id97aed9d6342c6c12e9b26acdd0a8c4b0bca0868 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Remove duplicated code from c++ and glsl completer.David Schulz2016-05-201-8/+110
| | | | | Change-Id: Ibda04771fceffef6344f6a6128d77dd8192379ca Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppEditor: Simplify insert matching characters.David Schulz2016-05-201-59/+61
| | | | | Change-Id: Ib3a94d016b615d71b1635ebe13a87575b8dc12c5 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update remaining files in src Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* C++: Accept language features in BackwardsScanner et alOrgad Shaneh2015-02-271-2/+3
| | | | | Change-Id: Id97ca27fa909979573efca12dc0cd14b28eacd17 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.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>
* | CPlusPlus: Simplify MatchingText interfacehjk2014-09-171-8/+5
|/ | | | | Change-Id: I46878d9ca048d0c79032445f5adc27c12d27f30c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@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>
* Fix coding style for else statementsOrgad Shaneh2013-07-171-1/+1
| | | | | Change-Id: I1309db70e98d678e150388c76ce665e988fdf081 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-2/+3
| | | | | | | | | | | ... 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>
* Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* CplusPlus: Remove pragma suppressing gcc warning.Christian Kandeler2012-10-151-9/+0
| | | | | | | | The respective warning was provoked by Qt code, which has been fixed and no longer causes that problem. Change-Id: I1b9efc2e6f9d2af7719d4c921f37f8335c351bfe Reviewed-by: hjk <qthjk@ovi.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++: Introduce unicode char/strings supportLeandro Melo2012-06-061-2/+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>
* Silence a warning about unrecognised pragma with ICCThiago Macieira2012-05-281-1/+1
| | | | | | | | | | | | src/libs/cplusplus/MatchingText.cpp(64): warning #161: unrecognized #pragma # pragma GCC diagnostic ignored "-Wstrict-overflow" ^ This pragma is recognised in GCC only, so don't enable it for when ICC fakes to be GCC. Change-Id: I3d9830dc2b12632dd08d8c8961219bd253ad8c1d Reviewed-by: hjk <qthjk@ovi.com>
* C++: Lambda formatting issues.Flex Ferrum2012-03-121-4/+9
| | | | | | | | Fix code formatting in cases when '{' and '}' appear within expression context (ex. lambda expression, initializer lists). Change-Id: I42b28170a8d6d5fd08a9a1a8d8e7698219c18966 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>
* 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>
* Disable gcc warning about always-true Q_ASSERT checkKai Koehne2011-08-171-0/+9
| | | | | | | | | gcc 4.5.1 warned about the Q_ASSERT in QStringRef::at() being always false for isCompleteStringLiteral, isCompleteCharLiteral. Change-Id: Idb20f81f92876eff685166c8deeebd6e151303b1 Reviewed-on: http://codereview.qt.nokia.com/3070 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Fix/add copyright headersTobias Hunger2011-05-061-1/+1
| | | | Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
* Update license.hjk2011-04-131-14/+13
|
* Exported header cleanup.Friedemann Kleint2011-01-201-0/+3
|
* It's 2011 now.con2011-01-121-1/+1
| | | | Reviewed-by: hjk
* License headers.con2010-12-171-7/+11
|
* Removing SimpleTokenErik Verbruggen2010-07-021-4/+4
|
* Removed the TokenCache.Erik Verbruggen2010-07-021-7/+2
|
* Merge branch '2.0'Thorbjørn Lindeijer2010-06-151-2/+2
|\ | | | | | | | | | | | | Conflicts: src/plugins/cppeditor/cppquickfix.cpp src/plugins/mercurial/mercurialjobrunner.cpp src/plugins/subversion/subversionplugin.cpp
| * Fixed handling of text wrapping and a text layout corner caseThorbjørn Lindeijer2010-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | Due to using QTextCursor::columnNumber() instead of QTextCursor::positionInBlock(), a lot of code would not work correctly when used with wrapped lines. In addition, there was an issue with columnNumber() returning 0 right after inserting a character before the last character of a line. Reviewed-by: mae
* | Merge branch 'origin/2.0' (early part)Erik Verbruggen2010-06-151-3/+3
|\ \ | |/
| * Don't pass QChar as const & since it's just a unsigned shortThorbjørn Lindeijer2010-06-141-3/+3
| | | | | | | | Reviewed-by: ogoffart
* | Introduced token caching to prevent repetetive tokenizing.Erik Verbruggen2010-06-141-3/+5
| | | | | | | | | | | | Also removed TokenUnderCursor as it's functionality is in the token cache. Reviewed-by: ckamm
* | Revert "Introduced a token cache for the C++ editor."Erik Verbruggen2010-06-041-5/+3
| | | | | | | | This reverts commit c2393df02332618c8cf6159d9d6f6a40041ced89.