aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangformat
Commit message (Collapse)AuthorAgeFilesLines
* Clang: Fix build with Clang/LLVM 10Orgad Shaneh2020-02-201-0/+8
| | | | | Change-Id: I740286c9dcfd325b1c31ab863fb5c91bf9c6ec70 Reviewed-by: hjk <hjk@qt.io>
* Remove apparently unneeded QtPlugin includeshjk2020-02-121-2/+0
| | | | | | Change-Id: I511c0318a72dbf2a92e4749dee02eabfc9826139 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Provide an empty default IPlugin::extensionsInitialized()hjk2020-02-071-1/+0
| | | | | | | And remove all empy re-implementations. Change-Id: I19f0b4e55c042c96693ecb89766f97f0a97b54ae Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Editor: add formatter supportDavid Schulz2020-01-222-20/+2
| | | | | Change-Id: I65590273b2541e08a39970cd9bb4739a5634b2f7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: move text replacement helper to Utils::TextDavid Schulz2020-01-092-46/+46
| | | | | Change-Id: I82b3304f91d575369e74d5f7404c189e14ba4730 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Editor: Rename format -> autoIndentDavid Schulz2020-01-092-8/+7
| | | | | | | | 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>
* Clang: Build against LLVM/Clang 9Nikolai Kosjar2019-10-021-0/+4
| | | | | | Change-Id: I3608bca6541614bb55e67d35c87334957cd02761 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
* Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-09-171-2/+3
|\ | | | | | | Change-Id: I887fbf79ebfdf2af2719cb0d8aa56ab3dcb08fab
| * ClangFormat: improve the message the users seeLisandro Damián Nicanor Pérez Meyer2019-09-121-2/+3
| | | | | | | | | | | | | | | | In this way it's made clear that the plugin requires a patched version of Clang. Task-number: QTCREATORBUG-22923 Change-Id: Ifefd5ab1a3dc82b85e553c5e1fedffb72919dd17 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Eike Ziller2019-09-122-3/+3
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/projectexplorer/gcctoolchain.cpp src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp Change-Id: Iffdf48e782a734107ea170ebb3812e997cea0e7b
| * Fix MSVC warningsOrgad Shaneh2019-09-112-3/+3
| | | | | | | | | | | | | | | | | | | | * Missing `this` captures * Implicit size_t -> int conversion * Unused argument * Suppress warnings in clang headers Change-Id: I7083ce6ab22ee22ecc1258539e77c790acc78df1 Reviewed-by: hjk <hjk@qt.io>
* | Fix compile after FileName dropChristian Stenger2019-07-241-1/+1
| | | | | | | | | | | | | | Amends 44acfc0702d0. Change-Id: I1bddb0642e181b0a02d4ecba7ff1ae282218338f Reviewed-by: hjk <hjk@qt.io>
* | Merge remote-tracking branch 'origin/4.10'Tim Jenssen2019-07-122-7/+2
|\| | | | | | | Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
| * Unify disabling build of llvm related plugins or test on WindowsChristian Stenger2019-07-051-5/+0
| | | | | | | | | | | | | | | | | | If libclang's build mode mismatches the current build mode of Qt Creator some plugins are automatically disabled. Do the same for the unittest and unify the way to do this. Change-Id: Ib4cd6494ed63cb89ed8d99b3c0ba23a19572fc9b Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * Avoid more deprecation warningshjk2019-07-051-2/+2
| | | | | | | | | | Change-Id: Icc7bb7a4ccf7fc9f89f6f668c194ccd440e5231c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Enable macro editing for the Clang indexerMarco Bubke2019-06-131-2/+2
|/ | | | | | | | Refactor much of the code from Environment* classes to NameValue* classes to share it with the preprocessor macro settings. Change-Id: Ica4ee817aa338230c422b30d91240d266248d226 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* ClangFormat: Provide an error message for Clang FormatMarco Bubke2019-06-111-1/+6
| | | | | | | | | | If an patch is not applied to libFormat in Clang we do nothing. It would be better to provide feedback if the plugin is loaded. Change-Id: Iea9900cf7683b521497cc6403638498a9ca5e2e9 Fixes: QTCREATORBUG-22404 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-283-18/+18
| | | | | | | | 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>
* ExtensionSystem: Move away from QListEike Ziller2019-05-271-1/+1
| | | | | | | | Qt 6 API will move away from it. Use QVector for API and some std container for internal things. Change-Id: Iff14d48a47d5ac52ade875d9c8c84ad8a4f577d8 Reviewed-by: hjk <hjk@qt.io>
* More FileName::appendPath() -> .pathAppended() changeshjk2019-05-271-3/+3
| | | | | Change-Id: Ibc7eb4eb3ffb64658e441aafa240b1ddc0061930 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* More FileName::pathAppended()hjk2019-05-201-9/+9
| | | | | Change-Id: Ie20ec34ea9712b3ec49e6233b23cef84c2019f03 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Qt Creator CMake portCristian Adam2019-05-171-0/+15
| | | | | | | | | | | | | | Based on Tobias Hunger's work from a few months ago. The CMake configuration needs libclang and Qt paths specified as CMAKE_PREFIX_PATH. Auto tests are run with "ctest". At the moment the pass rate is 87%. Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Some more FileName::appendPath() -> pathAppended() changeshjk2019-05-172-4/+4
| | | | | Change-Id: Ie494f7ae8a96d97c9497b3ef38d774d2cf787b7f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ClangFormat: Add the interaction with BeautifierIvan Donchevskii2019-04-293-5/+84
| | | | | | | | Do not allow ClangFormat plugin to format on file save when the Beautifier has the same checkbox selected. Change-Id: I655d77a888cc444ccb02c4e72f11a93b3ab9bbd5 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Do not reinitialize the configuration and previewIvan Donchevskii2019-04-292-24/+26
| | | | | | | Initialize them only once and only show/hide widgets later on. Change-Id: I5ebad504709e34aeb6ce5bf1ead7d8e2ee0b2056 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Fix compile with older gcc and MSVCChristian Stenger2019-04-291-1/+1
| | | | | | | Amends 2d8ce380c9f97. Change-Id: I44e7079ae40550e4d80a1717d4803d6864af99eb Reviewed-by: David Schulz <david.schulz@qt.io>
* ClangFormat: Fix UI issuesIvan Donchevskii2019-04-265-79/+143
| | | | | | | | | | | - 'Default' values remain so after save/load - the language is fixed to C++ - the project settings are shown correctly - fix parsing configuration file - do not trigger slots when we fill the table Change-Id: I91b477721b5084803324cd38d0cfeb9d5650dd9f Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Make UI not translatableIvan Donchevskii2019-04-251-409/+409
| | | | | | Change-Id: I69f8763f6337e8372e7bd24d82ea4b5f3f9fb7fe Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* ClangFormat: Fix qbs buildNikolai Kosjar2019-04-251-0/+1
| | | | | Change-Id: I3142eb99b5cfb9bd0c7c905d35e6172c0cdd8eb7 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* ClangFormat: Improve the configuration UIIvan Donchevskii2019-04-255-25/+3511
| | | | | | | | | | | | | Use QComboBox, QLineEdit and QPlainTextEdit to edit different option types. Show changes in the preview without pressing 'Apply' button. The clangformatchecks.ui file is generated with the python script that is a part of this commit. Change-Id: If5ff0acab6edd74f2e087e31fbd3ad1b9f847030 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* ClangFormat: Show the global fallback styleIvan Donchevskii2019-04-252-11/+16
| | | | | | Fixes: QTCREATORBUG-22144 Change-Id: I201dbccb8b1f1738451f760af34cf588afb5f4d5 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Centralize -Wno-comment for GCCOrgad Shaneh2019-04-232-8/+1
| | | | | | | It's also needed in clangrefactoringbackend, unittest etc... Change-Id: I9c758d52b34798d75610a4633bc7c5e7ceb0c00b Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang*: remove wrong cpp define from qbs filesDavid Schulz2019-04-231-1/+0
| | | | | | Change-Id: I1c7a5386b7ed0c117f0ed9c39c93af802e958a27 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge remote-tracking branch 'origin/4.9'Eike Ziller2019-04-121-0/+1
|\ | | | | | | Change-Id: I95c56cc9371959f96afde3677fc82481f36f66c8
| * Fix qbs build of clang format productAlexandru Croitor2019-04-101-0/+1
| | | | | | | | | | | | | | | | Not depending on CppEditor caused linker errors regarding the cpp highlighter class. Change-Id: Ib127cbe8e7d8eaa9e7d222dea88585164e49cdd2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/4.9'Orgad Shaneh2019-04-073-32/+81
|\| | | | | | | Change-Id: I7d1912cd5c4d824fd40d3454c5f1bb796f2c21d8
| * ClangFormat: Disable configuration UI instead of hidingIvan Donchevskii2019-04-031-5/+11
| | | | | | | | | | | | | | | | This is the first step without strings change. The next step is I201dbccb8b1f1738451f760af34cf588afb5f4d5. Change-Id: Ic0ce6a5ab3e74303a71a7c0bd8188d0284a241eb Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Fix indentation when empty lines are involvedIvan Donchevskii2019-04-021-25/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify continuation and new statement to get less false indentations. Handle one-statement if/else as a special case. Properly handle empty lines after - includes - preprocessor directives - beginning of the file - if/else Fixes: QTCREATORBUG-22238 Change-Id: Ic334eeca7de47d9fcb74963d2e31711838d04bde Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Use the global style if no configuration is foundIvan Donchevskii2019-04-021-2/+5
| | | | | | | | | | | | | | | | | | | | | | If no .clang-format file can be found and the settings do not override the configuration neither globally not in the project then construct the global settings (if required) and use them instead of constructing the style every time. Task-number: QTCREATORBUG-22144 Change-Id: Ib59b7f166f030ce3fb085f105f30fbf0eb25b185 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Fix showing the warning textIvan Donchevskii2019-04-021-0/+1
| | | | | | | | | | | | | | The call to show() was lost at some point, let's restore it. Change-Id: I83f551d26e6c4f658426b1196ff3a0935aea7047 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | Merge remote-tracking branch 'origin/4.9'Eike Ziller2019-04-022-23/+3
|\| | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/plugins/pythoneditor/pythoneditorplugin.cpp Change-Id: I9a95df5e16b34538539ced7dfc5d326b700794e6
| * ClangFormat: Fix GCC8 warningsOrgad Shaneh2019-04-012-23/+3
| | | | | | | | | | | | | | | | | | | | | | * Missing return (false positive. All enum values are covered). * Unused static function. Amends commits 7f0589ef591f6ff08a86ec6bca02248dc40443ef and 40fcc728b240ed5d4ad93de588537dd48d284183. Change-Id: I0e5c4ae09739a7ca9edbbbbe3f081d8a732245e7 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* | Merge remote-tracking branch 'origin/4.9'Eike Ziller2019-03-1412-175/+455
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/plugins/debugger/debuggerkitinformation.cpp src/plugins/languageclient/languageclientmanager.cpp src/plugins/plugins.pro src/plugins/projectexplorer/kit.cpp src/plugins/projectexplorer/kitmanager.cpp Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
| * ClangFormat: Extract switch statement into functionIvan Donchevskii2019-03-121-20/+24
| | | | | | | | | | | | | | Clarifies the logic and improves readability. Change-Id: I42668c65d73fb455996fa3a9bc5384f0b204a778 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Reduce dummy text to minimum sizeIvan Donchevskii2019-03-121-3/+3
| | | | | | | | | | | | | | | | ... and tweak continuation dummy text to fix the indentation for the line with existing text inside parenthesis. Change-Id: Iaebd2f58823fcbeed24bb7e47769af53261c18ca Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Tweak dummy text for consecutive empty linesIvan Donchevskii2019-03-121-8/+23
| | | | | | | | | | | | | | | | | | | | | | If empty lines follow each other it makes sense to use the empty comment as dummy text for all but the last one of them. This prevents increasing indentation lengths after if (foo) when there are multiple new empty lines inserted. Change-Id: I4c948161b674b3af0a131bfb85e7a45a80ed3fb0 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Fix the filepath to actually pick the selected configIvan Donchevskii2019-03-121-0/+7
| | | | | | | | | | | | | | | | | | | | We've searched for the config we want to use but did not change the path for the source file which is used internally by libformat to find the configuration. Fixes: QTCREATORBUG-22048 Change-Id: Ibdcc33ac338f06e966dfc5c06cdb38db3bb768b6 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Indent closing brace on the new lineIvan Donchevskii2019-03-121-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | Sometimes the curly brace also requires indentation. These are the cases when it comes directly after the comma, for example inside the initializer list. Lets handle such cases in the similar way we do it for the closing parenthesis. Change-Id: Ia0d25fa08f7224567dd41dd17f9757d9d8b27362 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Simplify the dummy text for empty line heuristicsIvan Donchevskii2019-03-111-62/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The text to fill the empty line mostly depends not on the fact of being inside parenthesis or not but rather on the last preceding meaningful character. Let's check for this character and sometimes for the following one to better understand the current context and pick the proper dummy text. With this behavior improvement we can better indent empty lines inside initializer lists with empty lines inside. Change-Id: Id2f27454ef56dfdf8c15b5efb14c4d09242908a9 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
| * ClangFormat: Use by default the same style as Qt Creator usesIvan Donchevskii2019-03-071-51/+104
| | | | | | | | | | Change-Id: Iae0f774873f66fcd4e297cfc260a8541f4373e36 Reviewed-by: Marco Bubke <marco.bubke@qt.io>