aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangformat
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: Adapt to LLVM 16Björn Schäpers2022-11-062-0/+8
| | | | | | Change-Id: I2e35f92db6de10b1e4bf173f0864f0cd893a011f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangFormat: Fix wrong comment indentationArtem Sokolovskii2022-10-263-2/+23
| | | | | | | Fixes: QTCREATORBUG-25539 Change-Id: Ifecc4bc2c0984319d858720d5bcd1788a9008e90 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ClangFormat: Remove deprecated entries in clangformatconfigwidgetArtem Sokolovskii2022-10-191-375/+288
| | | | | | Task-number: QTCREATORBUG-28263 Change-Id: I48b0456f3c7bea88905cea40d1e447655da64676 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix compiler warningsEike Ziller2022-10-131-2/+2
| | | | | | | | | | - private field 'm_postId' is not used - private field 'm_hostChecked' is not used - missing field 'AcrossEmptyLines' initializer Change-Id: I1e31c79e078bcb68d053202ad322299b92c4fa38 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* ClangFormat: Avoid warning about unused parameterhjk2022-09-201-1/+1
| | | | | | | Style follows precedent in the file. Change-Id: Id7e5ca3f4e9536cb803e8e0ff36db59fda3c41d5 Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangFormat: Remove extra margins around ConfigWidgetAlessandro Portale2022-09-161-1/+1
| | | | | Change-Id: I542ce841bf1144d4063190d1ec83fef7c1295248 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangFormat: do not remove trailing spaces on indent calculationDavid Schulz2022-09-142-5/+8
| | | | | | | | | Fixes: QTCREATORBUG-28150 Change-Id: I6f7b18e1afefb96da28295a2c3654d1c1ced4308 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* FilePath: Return optional bytearray for file contentsEike Ziller2022-09-122-9/+12
| | | | | | | For differentiating between "error" and "empty file". Change-Id: I2c019ceac625e7be3180afa4d47ae3a24df91c1d Reviewed-by: hjk <hjk@qt.io>
* ClangFormat: Add missing overrideEike Ziller2022-09-071-1/+1
| | | | | | | Change-Id: I8ed5918471935d21ae7036081cc45d6430c295d2 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangFormat: Fix compilation with LLVM 15Björn Schäpers2022-09-021-1/+3
| | | | | | Change-Id: I7990e8331c317d3bc363be610b2585d37dee4445 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Remove Utils::optionalEike Ziller2022-09-015-6/+7
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-2620-480/+40
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangFormat: Move override checkbox to global settingsArtem Sokolovskii2022-08-244-67/+65
| | | | | | | Moved override checkbox to global settings groupbox. Change-Id: I70c97486a61f69274d059edc5095fe02c86fb04d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangFormat: Fix list declarationArtem Sokolovskii2022-08-233-15/+106
| | | | | | | | | | Fixed list declaration indentation. Fixed function declaration with parameters on the new line. Added tests for both cases. Fixes: QTCREATORBUG-25011 Change-Id: Ida4f6ec4f407c5e5b015dc2c0afff110262d9645 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangFormatConfigWidget: Avoid using sender()Jarek Kobus2022-08-222-16/+11
| | | | | | | Use Utils::Guard instead of Utils::ExecuteOnDestruction. Change-Id: I7f2be9c3864d9cac31423353d46dfa98660dd0af Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-08-191-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts/comments out parts of 45f93a817a527e6dc81a8971dd2868b3da66cd84, which needs to be resolved in a follow-up commit. Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp src/plugins/clangcodemodel/clangmodelmanagersupport.cpp src/plugins/cmakeprojectmanager/cmakesettingspage.cpp src/plugins/python/pythoneditor.cpp src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp src/plugins/scxmleditor/common/colorsettings.cpp Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
| * ClangFormat: Fix ignoring DisableFormat optionArtem Sokolovskii2022-08-091-1/+0
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-27261 Change-Id: Ib9671f5c4499a39eb40e2a269dc73328fa5ad12f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | ClangFormat: Fix build for LLVM 15.0.0Cristian Adam2022-08-182-0/+4
| | | | | | | | | | | | | | | | This fixes the CMake build of Qt Creator against LLVM 15.0.0 Change-Id: Icecd45821091c8c2b565246cb17ce5a6e5c49f36 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | CodeStyle: Remove edit pop-upArtem Sokolovskii2022-08-164-16/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed the Edit pop-up on the CodeStyle page. Now editing is available immediately after opening CodeStyle tab. I left a preview on the project CodeStyle page and added a link to global settings. ToDo: In project CodeStyle page replace preview with CodeStyleEditor. I'm not 100% sure that it is needed. If you have some thoughts please write a comment. Change-Id: I31032a97b9668b4f6b06fc6c5c704700fb44ee4f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ClangFormat: Inline *.ui fileshjk2022-08-057-140/+133
| | | | | | | | | | Change-Id: Ie6bcb486c70896894121434b1030861b029a46a2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ClangFormat: Move global settings in main pageArtem Sokolovskii2022-08-059-112/+254
| | | | | | | | | | | | | | | | | | The settings: indenting instead formatting, format while typing, format edited on file save are moved to Code Style page. Change-Id: I28787b44602ce288961c778fe704ad2a1a05913f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ClangFormat: Update clangformatchecks.ui fileArtem Sokolovskii2022-07-282-425/+2056
| | | | | | | | | | | | | | | | File updated by scripts/generateClangFormatChecksUI.py Fixes: QTCREATORBUG-27952 Change-Id: Ib7ffbf1f416a4edffc130a00ae8348d2ac9ed010 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Drop Qt5: Clang, QBS & Valgrind: Get rid of QOverloadJarek Kobus2022-07-201-12/+9
| | | | | | | | | | Change-Id: I86697f07a8dce5674d6e748bce807df59b773227 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-07-121-0/+2
|\| | | | | | | Change-Id: I37a1f78caf9ae258c6b052efa3be15b3dbcbe164
| * ClangFormat: Fix saving settings for standard code styleArtem Sokolovskii2022-07-081-0/+2
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-27269 Change-Id: I8ddd30e55989dc3f9ee83d3cb1a3c2a794144da8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-07-0411-13/+111
|\| | | | | | | | | | | | | Conflicts: src/plugins/qmldesigner/qmldesignerprojectmanager.cpp Change-Id: I5106bb632c2a3a144287097137be45b0894b9ee4
| * Clangformat: Brings back some of checkboxesArtem Sokolovskii2022-06-3011-13/+111
| | | | | | | | | | | | | | | | | | | | | | Brought back checkboxes: format while typing, format on save. Brought back format while typing feature. Global checkboxes will be hidden in project settings, and visible for global. Change-Id: I193cf9e13b10de22091edb5fe04aef957dd74586 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Merge remote-tracking branch 'origin/8.0'Eike Ziller2022-06-293-8/+20
|\| | | | | | | Change-Id: I552d201d09d62d21655176467088c6e48b8a2fe2
| * Revert "ClangFormat: Remove format while typing feature"Artem Sokolovskii2022-06-293-8/+20
| | | | | | | | | | | | | | | | | | This reverts commit 323ba720db49d76e135f509a0782ff7486a5b52e. Reason for revert: The feature is needed Change-Id: Iaf09ef91c49ff0c85c1b5906a1c1464bd8e4cae6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Add plugintr.h files to all pluginshjk2022-06-271-0/+37
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Except FakeVim, which had it before. for i in [a-eg-z]*/*.json ; do upper=${i##*/} upper=${upper/.json/} lower=${i%/*} trfile=$lower/${lower}tr.h cat << EOT > $lower/${lower}tr.h /**************************************************************************** ** ** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ namespace $upper { struct Tr { Q_DECLARE_TR_FUNCTIONS($upper) }; } // namespace $upper EOT git add $trfile perl -pi -e "s/(${lower}_global.h)/\1\n ${lower}tr.h/" $lower/CMakeLists.txt perl -pi -e "s/(\"${lower}_global.h\",)/\1 \"${lower}tr.h\",/" $lower/$lower.qbs done Change-Id: I15ebbaaa9443c57b391b9e143f592d8a0c9208a9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangFormat: Convert old settings to a new onesArtem Sokolovskii2022-06-031-3/+22
| | | | | | | | | | Added possibility to convert old setting to new one out of the box. So now, if options FormattingInsteadOfIndentting or FormatOnSave was set the mode will be set to Formatting. Change-Id: I3c30ca8543d4fe25d1a44665d286f27ac2102c52 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ClangFormat: Remove format while typing featureArtem Sokolovskii2022-05-253-20/+8
| | | | | | Change-Id: I6737c429694218d39fc06c9ef3ce502228e26a2a Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CMake: Remove libclang referencesCristian Adam2022-05-241-1/+1
| | | | | | | | | | Now that libclang is no longer used, make sure that all references to libclang are gone. Change-Id: I4b66eff992b22adb6a9c25d34053f2b36079583c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangFormat: Add disable optionArtem Sokolovskii2022-05-199-106/+73
| | | | | | | | - Added a possibility to disable ClangFormat plugin - Removed unneeded properties from clangformatsettings Change-Id: If71f46670e4fd3d2dac6d18c97df5a811504ed5e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ClangFormat: Ignore compiler warnings in clang-format headersEike Ziller2022-05-171-1/+5
| | | | | | | | | | By making the include paths "system" includes. Change-Id: Idf417195b921c2cd861efc24b814a30f5739eef5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ClangFormat: Build fix Qt 5Artem Sokolovskii2022-05-161-8/+9
| | | | | | Change-Id: I5afec32314263dfa9db6f36b8871b43fde47f698 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangFormat: Fix override checkbox doesn't affect behaviorArtem Sokolovskii2022-05-163-58/+82
| | | | | | | | | | | Override checkbox allows use clangFormat settings from widget even if there is .clang-format file in file's folder or parent folder. It works for global settings and for project settings. Change-Id: I03152f4b0e1b62b3ac038024e76cc9082fa37ec3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-05-101-5/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/clangformat/clangformatconfigwidget.cpp src/plugins/clangformat/clangformatplugin.cpp src/plugins/cppeditor/cppcodestylepreferencesfactory.cpp src/plugins/cppeditor/cppcodestylepreferencesfactory.h src/plugins/nim/settings/nimcodestylepreferencesfactory.cpp src/plugins/nim/settings/nimcodestylepreferencesfactory.h src/plugins/qmljstools/qmljscodestylepreferencesfactory.cpp src/plugins/qmljstools/qmljscodestylepreferencesfactory.h src/plugins/texteditor/codestyleselectorwidget.cpp src/plugins/texteditor/icodestylepreferencesfactory.h Change-Id: I20ee430a7f0085774c9df1aa5487046ba4f404c1
| * ClangFormat: Fix settings checkboxes disappearanceArtem Sokolovskii2022-05-102-7/+6
| | | | | | | | | | | | | | | | | | | | - Fixed settings checkboxes disappearance after open a project - Fixed impossibility to save settings Task-number: QTCREATORBUG-26948 Change-Id: Ia73a61bf56b99adea9ed45c9d656860b185a3d7e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | ClangFormat: Remove unneeded warningArtem Sokolovskii2022-04-261-0/+3
| | | | | | | | | | | | | | | | | | - Remove warning when .clang-format file is absent - Remove warning when a page is nullptr in addTab function Change-Id: I4232bc77eaac56c78707fc37aaf75b00b8af9006 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ClangFormat: Start to use new file managementArtem Sokolovskii2022-04-208-14/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Indenter uses .clang-format file from a dir of editing file or from a parent dir. If there is no such file then indenter starts to use file from a dir with the name current CodeStyle settings. - Test fixed ToDo: Add file absentness processing in case of import Change-Id: If09ef0c598899856b948c214e524bcfd5dad76e2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ClangFormat: Add the logical settings managementArtem Sokolovskii2022-04-117-26/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now there are changeable and unchangeable settings, as it works for usual codestyle settings. They save parallel with codestyle settings but in another dir. In general, the behavior became similar to usual codestyle settings. ToDo: Make indenter use this settings instead standard one and instead project settings when "override" checkbox is checked. Change-Id: I639dbda296932bf9b967a11f1cc4fda120415ed9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-03-311-0/+6
|\| | | | | | | Change-Id: Ib2267ddbb702564a6e1c8f6b1db802bc9c45759d
| * ClangFormat: Fix build on Windows and macOSChristian Stenger2022-03-301-1/+6
| | | | | | | | | | | | | | Amends 355c5a7c7334e2813. Change-Id: I4c350d92766e35fca2230c756fb07772e0524c08 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * ClangFormat: Avoid interfering llvm libs for qbs as wellChristian Stenger2022-03-291-0/+1
| | | | | | | | | | | | Task-number: QTCREATORBUG-24998 Change-Id: I7dbf0f08358ea0dca096074320ac6446c65cfe68 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ClangFormat: Fix unsaving properties for global settingsArtem Sokolovskii2022-03-301-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fixed behavior "Formatting mode" combobox settings isn't saved after pressing "Ok" button when no one project is open. Now it works as expected, settings save after press "Ok" button. - Added additional applying interface for ICodeStylePreferenceFactory which allows pass-through apply call from dialog to the editor. Note: it doesn't work with read-only code style profiles Change-Id: If4f0c85e3105550db4ffd9860e94b678f0d9b386 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-03-281-1/+4
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/studiowelcome/recentpresets.h src/plugins/studiowelcome/userpresets.h Change-Id: Ie573b945eb28347a36ee1b3582fbd6ab0c0f866c
| * ClangFormat: Adapt to LLVM 15 API changeChristian Kandeler2022-03-251-1/+4
| | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-27170 Change-Id: I3676792da351f52199b1bf303c596e581469d7a5 Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | ClangFormat: Fix build with Qt5Christian Stenger2022-03-281-1/+1
| | | | | | | | | | | | | | Amends 4022ed547defe2e. Change-Id: I66fc822443c8353209446cf7973a3db9dc52debe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | [ClangFormat] Remove redundant checkboxesArtem Sokolovskii2022-03-254-106/+38
|/ | | | | | | | | | | | | - Removed redundant checkboxes - Removed apply button - Combined checkboxes to combobox ToDo: - Specify behavior for global and project settings Change-Id: I39a00ac8439ae7be3041890f7fc882849685d102 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>