aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/indenter.h
Commit message (Collapse)AuthorAgeFilesLines
* TextEditor: Remove wrong commentNikolai Kosjar2020-05-131-1/+0
| | | | | Change-Id: I42883a4cdaa5c1fdd89f73ed73b8e25a550dbbec Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: move text replacement helper to Utils::TextDavid Schulz2020-01-091-17/+3
| | | | | Change-Id: I82b3304f91d575369e74d5f7404c189e14ba4730 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Editor: Rename format -> autoIndentDavid Schulz2020-01-091-4/+4
| | | | | | | | Renaming the auto indent function triggered by Ctrl+I to make room for a real format action. Change-Id: If5731353311030d66a20f1093a7fdd300703ebbc Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-3/+3
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangFormat: Format multiple text ranges at onceIvan Donchevskii2019-02-191-3/+10
| | | | | | | | | 'reformat' function in LibFormat accepts mutilple ranges. Let's provide the ranges for the same file together when formatting on save and formatting after fix-its. Change-Id: I27789da83a1efc27beb57acf238508a191562bb9 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangTools: Do not format code after fix-its without ClangFormat pluginIvan Donchevskii2019-02-071-4/+3
| | | | | | | | | | | Applying analyser fix-its triggers formatting after each fix-it. In case of no ClangFormat plugin this instead lead to indentation call. Do not trigger anything instead when ClangFormat is not enabled. Task-number: QTCREATORBUG-21880 Change-Id: I2f9e6e69be0366d2bb0701228bb5d562ef0095f2 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangFormat: Format edited chunks of file on saveIvan Donchevskii2019-02-051-0/+2
| | | | | | | | | | | | | The similar implementation to the one in Beautifier plugin with the difference that the clangformat indenter logic is used and only modified chunks are formatted. That means that all code which was not touched will stay in the initial condition. Change-Id: I47b11eb99852454ed0031ef6cfc6dbed1ecd390d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Add cursor position to the indenter interfaceIvan Donchevskii2019-01-311-9/+18
| | | | | | | | | Sometimes it's imnportant where the cursor currently is to properly format the code without affecting the current line. Change-Id: I8b1fb11d2303adb5f960c7cb80a0ed2e6e45010f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Introduce check to format code instead of indentingIvan Donchevskii2019-01-311-3/+15
| | | | | | | | | Ctrl+I with the new check will reformat the selected code or the current line instead. Change-Id: Ia5a72c4a09621034d0dfe463f669fe1ca36b0b5f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Refactor indenter to allow ClangFormat unit-testsIvan Donchevskii2019-01-221-41/+43
| | | | | | | | | | We do not build texteditor files in unit-tests so some tricks were required to make ClangFormatIndenter available. First simple unit-test proofs it builds and runs. Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* ClangTools: Apply indention/formatting after fix-itsIvan Donchevskii2018-12-211-0/+3
| | | | | | | | | | | | Fix-its do not follow the current formatting style therefore apply indention/formatting by using indenter. This change will work best when ClangFormat plugin is enabled to not only reindent line but also format it. Task-number: QTCREATORBUG-21448 Change-Id: I8bcafcf49f3118aff7840326547e7a24052469b2 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Return replacements from 'format' callIvan Donchevskii2018-12-111-3/+19
| | | | | | | | | | | | | We want to have the results of the 'format' call in order to have understanding what has changed and if the existing offsets have to be adjusted. One of the possible use cases is the formatting after fix-its. If we apply several fix-its in the same file we need to know after each of them if the further ones are affected and shift them. Change-Id: I17e8f4dbcf6d36224ab7da9e11035cf3be3d3125 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Do not format text but indent onlyIvan Donchevskii2018-11-141-0/+5
| | | | | | | | | | | | Provide the separate infrastructure for the formatting but use it only when QTC_FORMAT_INSTEAD_OF_INDENT is provided in run environment. Fixes: QTCREATORBUG-21447 Fixes: QTCREATORBUG-21459 Change-Id: I1ad6fe23f5de17016c0c7b18749c6977fc03a22b Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Use clang-format for indentationIvan Donchevskii2018-09-121-1/+7
| | | | | | | | | | | | | | | | | | | This is the new experimental plugin based on LibFormat. It replaces the default indenter for CppEditorDocument and applies clang-format after the CR or the set of 'electric' characters. Uses the global .clang-format kept in QtC settings or the one for current project. Both can be configured. For indentation some style modifications and code manipulations are done to prevent line shrinking when it's not expected. Manual indentation uses unmodified style from .clang-format file. Change-Id: I6279b805e418e1804b553efa615f5c843f395a58 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Editor: Collect indentation for a list of text blocksDavid Schulz2016-08-311-0/+8
| | | | | | | | Allows the indenter to reuse code formatter structures. Task-number: QTCREATORBUG-16420 Change-Id: Ie906d7fdcb50798da02ef5b750fb03ae752aadc1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Wholesale conversion to #pragma oncehjk2016-03-301-4/+1
| | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Editor: Fix whitespace cleaning.David Schulz2016-02-241-0/+2
| | | | | | | Task-number: QTCREATORBUG-7994 Change-Id: I6c197ccc3a148555018e8f8184d116c88d7ea400 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* License updateEike Ziller2014-10-091-7/+8
| | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@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>
* Clean headers in TextEditor.Friedemann Kleint2013-03-271-2/+0
| | | | | Change-Id: Ie679e7e9d0d20a0f71dcc1fcf0f7d8305eeeeced Reviewed-by: Fawzi Mohamed <fawzi.mohamed@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>
* Adjust license headershjk2012-10-051-21/+20
| | | | | Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Contact -> qt-project.orgEike Ziller2012-07-191-3/+1
| | | | | Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Removed module names from #include directives.Erik Verbruggen2012-02-151-1/+1
| | | | | | | | 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>
* Implement Code Style schemesJarek Kobus2011-09-231-2/+4
| | | | | | | | Task-number: QTCREATORBUG-5092 Change-Id: I218cef02f7c242e4dfae59b1b8021ea618e60d07 Reviewed-on: http://codereview.qt-project.org/5160 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* Refactor: Get rid of BaseTextEditorWidget from IndenterJarek Kobus2011-08-051-4/+4
| | | | | | | | | | | Provide directly TabSettings instead. This will be used for indenting a text for which there is no editor instance. Change-Id: Ia5f11a481f42464cf4820efdf2c7c4c32166f55e Reviewed-on: http://codereview.qt.nokia.com/2622 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
* Make C++ code style configurable.Christian Kamm2011-05-241-0/+3
| | | | | | | | | | | | | | Change-Id: Iaf08edb2361146e6b5e1cbafdb716a23c938875b Done-with: Jarek Kobus Task-number: QTCREATORBUG-2670 Task-number: QTCREATORBUG-4310 Task-number: QTCREATORBUG-2763 Task-number: QTCREATORBUG-3623 Task-number: QTCREATORBUG-567 Reviewed-on: http://codereview.qt.nokia.com/74 Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix/add copyright headersTobias Hunger2011-05-061-1/+1
| | | | Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
* Update license.hjk2011-04-131-14/+13
|
* texteditor: merge ITextEditable into ITextEditorhjk2011-02-221-4/+4
| | | | | | | | rename BastTextEditor->BaseTextEditorWidget, BaseTextEditorEditable->BaseTextEditor rename BaseTextEditor{,Widget} subclasses rename editableInterface->editorInterface rename createEditableInterface->createEditor minor cleanups after renamings
* Exported header cleanup.Friedemann Kleint2011-01-201-2/+3
|
* It's 2011 now.con2011-01-121-1/+1
| | | | Reviewed-by: hjk
* 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
| |
* | Editors: Move auto-completion code out of the editorLeandro Melo2010-12-011-22/+13
| | | | | | | | | | | | | | | | | | This is basically a continuation of the commits which refactor code out of the base text editor. For instance, 36fa1de4c6a15b2c44736b3491679dd6cfbe27ce and 3a684586fabf103b8e09cef31a18ffae1fd9f0c7. Also removed the doXXXX() forwarding methods.
* | Editors: Continue refactoring indenters out of the editors.Leandro Melo2010-11-091-1/+6
| | | | | | | | | | | | | | This is pretty much a complement of commit 3a684586fabf103b8e09cef31a18ffae1fd9f0c7, which is an attempt to make editors and indenters a bit more decoupled. Reviewed-by: Thorbjorn Lindeijer
* | Editors: Refactor indenters out of the editors for better reusability.Leandro Melo2010-11-051-5/+21
|/ | | | Reviewed-by: ckamm
* Replace some struct with classesTobias Hunger2010-08-131-1/+1
| | | | | | * Fixes warnings about struct/class mixup in windows Reviewed-by: thorbjorn
* Indenter is now a separate class which can be reused through composition. ↵Leandro Melo2010-05-141-0/+63
Added it to the generic editor.