aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/beautifier/beautifierplugin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Beautifier: Remove inner namespace levelhjk2020-06-191-3/+3
| | | | | | | | | | | And inline non-shared object id. I regularly stumble over this speciality when doing mass refactorings in the code base and I believe the extra benefit this namespace level has does not outweigh it. Change-Id: I3694a656f1095dcb5509b212b9e1d25ae5c8b5ec Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Beautifier: Remove dependency on CppEditor and DiffEditorAlexis Murzeau2020-06-051-1/+0
| | | | | | | | | | | | | | | Beautifier plugin depends on CppEditor and DiffEditor at the project level, but it does not require them to be built and used. There is also unused includes to "cppeditor/cppeditorconstants.h". So this commit remove the unused includes (which makes Beautifier not use any of CppEditor code) and the dependencies on CppEditor and DiffEditor. This allow the user to disable CppEditor plugin and use LSP instead with the basic TextEditor. Change-Id: If83f30e754746f1635934e5f952bf9254e83c42f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Make TextEditor setup more flexibleEike Ziller2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | So far it was only possible to combine TextEditorFactory, BaseTextEditor and TextEditorWidget directly. That TextEditorWidget is also directly a QPlainTextEdit made it impossible to "decorate" the text editor widget with something else without a lot of effort. Make it possible to create a text editor factory that returns an arbitrary widget, as long as it can be "cast" to a TextEditorWidget with either qobject_cast or Aggregation::query. That way the TextEditorWidget instance can be attached to the editor widget via Aggregation. Adapt other code that accesses TextEditorWidget from editors accordingly. Introduce a common method how to do that. Change-Id: I72b8721f3a8a8d8281c39af75253e9c80cbe1250 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: David Schulz <david.schulz@qt.io>
* Beautifier: Avoid QObject parent in options pagehjk2020-02-101-11/+13
| | | | | Change-Id: I7e1162802fb6d7d7dffe143dbcdf6d85dc18d56f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Beautifier: Use new IOptionsPager convenience functionshjk2020-01-101-7/+6
| | | | | Change-Id: I90510d9f7b77bf286fd342cdfea88964d12571b2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Project: Delay acting on fileListChanged signalTobias Hunger2019-06-201-2/+8
| | | | | | | | This gives the UI a bit more opportunity to render after the project was parsed. Change-Id: Ie316f1c69cb0ebb856943a094b81b55f1aa2317a Reviewed-by: hjk <hjk@qt.io>
* Project: Avoid copying the entire files(...) listTobias Hunger2019-06-191-1/+1
| | | | | | | | Avoid copying the entire list of files known to a project just to filter out a couple of files from it. Change-Id: I58b2e323f9678058ba482353eb777a55189fe05d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Beautifier: Reduce indirectionshjk2019-04-081-3/+1
| | | | | | | | | | | The two-phase initialization of the tools is not needed, as the second phase is called directly after construction. Also, the settings objects' lifetime is identical to the tools, no need to handle that dynamically. Change-Id: Iedfe8a95d68f9a667ef60ad9a107d0bae142b2cc Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Beautifier: ModernizeAlessandro Portale2018-11-141-1/+1
| | | | | | | | | modernize-use-auto modernize-use-override modernize-use-equals-default Change-Id: I33158ef1c708fb44e0efa1c9b1b0e2f63758a6d7 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Beautifier: Move formatting tools to TextEditorIvan Donchevskii2018-08-301-336/+3
| | | | | | | | | | | | Formatting is moved from Beautifier plugin to formattexteditor.h/.cpp. Diff and Differ classes are extracted from DiffEditor to Utils to prevent extra TextEditor dependencies. This change will make possible to use formatCurrentFile and similar functions not only from Beautifier code. Change-Id: Ic5ca668afe88f4e9376d49e6bd3594807172b0dd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Beautifier: Re-organize internal interfacehjk2018-02-091-25/+71
| | | | | | | | | - pimpl BeautifierPlugin - apply "static" pattern - remove use of global object pool Change-Id: I7a4ab2493d5b29787aca258d1bc46ab00a697176 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Project: Make Project::files return a FileNameListTobias Hunger2017-12-081-2/+1
| | | | | Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: move convenience from texteditor to utilsIvan Donchevskii2017-09-221-2/+2
| | | | | | | Allows to use this header without texteditor dependency. Change-Id: I706f42799c3ea42473a716fa9ef9f3cfbef6fdd4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Beautifier: ClangFormat: Format current syntactic entity for no selectionNikolai Kosjar2017-09-211-0/+6
| | | | | | | | | | | | | | | | In case there was no selection, the action "Format Selected Text" could format the whole file (option) as a fallback. However, there is also the use case of formatting the syntactic entity under the cursor. Introducing another separate action for this feels wrong, so remove the fallback instead since there is already an action handling this. Change-Id: Ia73f6074433e706bb4c2d375ad5b84dd59bc93a3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de>
* Beautifier: ClangFormat: Add action "Disable Formatting for Selected Text"Nikolai Kosjar2017-09-211-0/+6
| | | | | | | | Change-Id: I0786dfdc0679bbdf1cf1157067bd7f572ac7d108 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de>
* Beautifier: Add accelerators to menu itemsOrgad Shaneh2017-07-131-3/+3
| | | | | | | Change-Id: Ie94b09ed640df457235be6b8a145d953c4eca03e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Beautifier: Minor cleanupOrgad Shaneh2017-07-101-8/+5
| | | | | | | | * Use initializer list and Utils::transform * Remove unneeded override Change-Id: I36ff9b9900fa6169ed1529bbbbdba13075353332 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Beautifier: Fix leak of GeneralSettingsNikolai Kosjar2017-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x4f06b0 in operator new(unsigned long) (/home/nik/dev/creator/ ut/4.2_asan/bin/qtcreator+0x4f06b0) #1 0x7f4ac0e5d068 in Beautifier::Internal::BeautifierPlugin::initialize(QStringList const&, QString*) /home/nik/dev/creator/ut/4.2_asan/src/plugins/beautifier/ beautifierplugin.cpp:214:25 #2 0x7f4ada1bb769 in ExtensionSystem::Internal::PluginSpecPrivate::initializePlugin() /home/ nik/dev/creator/ut/4.2_asan/src/libs/extensionsystem/pluginspec.cpp: 1001:10 #3 0x7f4ada1694b1 in ExtensionSystem::Internal::PluginManagerPrivate::loadPlugin(ExtensionSystem::PluginSpec*, ExtensionSystem::PluginSpec::State) /home/nik/dev/creator/ut/4.2_asan/ src/libs/extensionsystem/pluginmanager.cpp:1404:9 #4 0x7f4ada15b2b6 in ExtensionSystem::Internal::PluginManagerPrivate::loadPlugins() /home/ nik/dev/creator/ut/4.2_asan/src/libs/extensionsystem/pluginmanager.cpp: 1239:9 #5 0x7f4ada15ac6f in ExtensionSystem::PluginManager::loadPlugins() / home/nik/dev/creator/ut/4.2_asan/src/libs/extensionsystem/ pluginmanager.cpp:362:12 #6 0x50a97c in main /home/nik/dev/creator/ut/4.2_asan/src/app/ main.cpp:517:5 #7 0x7f4ad65b282f in __libc_start_main /build/glibc-Qz8a69/ glibc-2.23/csu/../csu/libc-start.c:291 Change-Id: Iff1fd908d9a59b98e895599b1d73ca16536eee11 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Wrap MimeDatabase into static functionshjk2017-03-031-2/+1
| | | | | | | | To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra all over the place. Change-Id: I4bfef62e73275a991455141671d6071162788e9d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Beautifier: Simplify small code fragmentLorenz Haas2017-02-251-12/+8
| | | | | Change-Id: I906d7803ccc6856b09fc25fdea7c7c3d112f4e77 Reviewed-by: David Schulz <david.schulz@qt.io>
* Beautifier: Get rid of QRegExpLorenz Haas2017-02-231-2/+5
| | | | | Change-Id: If3f7e6d93ef1f0b6920f0958f1e2eb00c37462bf Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Introduce a TemporaryDirectory and TemporaryFile classTobias Hunger2017-01-201-1/+3
| | | | | | | | Both wrap the corresponding Qt class, but make sure all temporary files or directories are created inside a "master temporary directory". Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Beautifier: Move initialization to extensionsInitialized()Ulf Hermann2016-11-081-4/+4
| | | | | | | | Beautifier makes heavy use of mime types which shouldn't be accessed in initialize() as that doubles the overhead for parsing them. Change-Id: Ie731f1194f281e9574ef914d67537651658ea9e7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* SynchronousProcess: Store raw bytes from stdout/stderr of the processTobias Hunger2016-07-151-1/+1
| | | | | | | | | | | | | | | Only convert the raw output later in a stdOut() and stdErr() method of the SynchronousProcessResponse. This is necessary since we have processes that use different encodings for different sections of the file (I am looking at you, git). Also remove the signals for raw data on stdout/stderr, leaving only the signals returning buffered QString lines. This should be safe, even with UTF-16 output. Change-Id: Ida613fa86d1468cbd33bc6b3a1506a849c2d1c0a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Beautifier: Fix untranslated DISPLAY_NAMETakumi ASAKI2016-06-221-1/+1
| | | | | | Change-Id: Ifad91eaada5f7614767b6332a643723de79fc6b2 Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Fix code styleLorenz Haas2016-06-071-1/+1
| | | | | Change-Id: I991f47d2f6844b153cd47ac856e5a76a7a962c94 Reviewed-by: hjk <hjk@theqtcompany.com>
* Beautifier: Make all tools MIME restrict-ableLorenz Haas2016-06-011-16/+15
| | | | | | | | | | | | The newly introduced auto save option is restricted to user definable MIME types. The underlaying tool's restriction, however, is only if the current editor is a cpp editor. This patch makes the tools also MIME types restrict-able. In addition the auto save functionality is now only applicable if the file matches the auto save MIME types as well as the MIME types of the chosen tool. Change-Id: Ic430b4a07341647e6c8e95d2b802a17db1637a36 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Use SynchronousProcess::runBlockingTobias Hunger2016-05-261-1/+1
| | | | | | | | | | | | | Use SynchronousProcess::runBlocking in favor of SychronousProcess::run. This avoid nested event loops which can produce really strange crashes if not use carefully. This patch only converts those processes that have a timeout of less than 5 seconds or use the default timeout. Change-Id: I9de8899dcc946af7049ea357a91972996c0256a1 Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Beautifier: Add option to automatically format files on saveLorenz Haas2016-05-151-8/+78
| | | | | Change-Id: I72fb3f4b728df7ef3e449c1202df9cbb0279dde4 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Fix up QProcess::waitForFinished()Tobias Hunger2016-05-111-12/+11
| | | | | | | | waitForFinish returns false if the process is no longer running at the time of the call. Handle that throughout the codebase. Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094 Reviewed-by: hjk <hjk@theqtcompany.com>
* Beautifier: tr()-FixesTakumi ASAKI2016-05-111-5/+5
| | | | | | | Do not use QObject::tr(). Change-Id: Ib77f78ead649bcfee326fb9f8acde1df7784437b Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Beautifier: Modernize, code style, and clean upLorenz Haas2016-05-021-25/+21
| | | | | | | | | | | Use nullptr and range based for loops, unify initializer list code style, remove superfluous includes, make private slots private methods, get rid of QLatin1(Char|String), use initializer lists and some minor code style issues. Change-Id: I94ba10fc96bb628239364a8201bde98a66b2c4c1 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Use "timeout" consistentlyRobert Loehning2016-04-201-2/+2
| | | | | Change-Id: Ic4e2ba6269bd61eb2fa2bbef1e1c24c05f91e6a5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Beautifier: Fix clang-format's custom style handlingLorenz Haas2016-04-141-0/+1
| | | | | | | | | Instead of dealing with clang-format's YAML format use proper command line parameters. Task-number: QTCREATORBUG-15604 Change-Id: Ie0b22aff105c8d208d30e2e945b0036b0b8606c1 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Fix hidden menu on LinuxLorenz Haas2016-03-311-4/+2
| | | | | | Task-number: QTCREATORBUG-15936 Change-Id: Id9387495a8c770167292fa526727f969b7408b2c Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Refactor formatting APILorenz Haas2016-02-291-154/+169
| | | | | | | | | Break former monolithic methods into modular ones and re-introduce synchronous formatting. Change-Id: Ic4d8cbe451f028c7a3677570242cff9a2e362384 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Marcel Mathis <marcel.mathis@komaxgroup.com>
* Beautifier: Use Utils::runAsyncEike Ziller2016-02-151-2/+2
| | | | | | | Gets rid of usage of global thread pool and ugly implementation. Change-Id: If7ca1f479bb837e61fa7f57535b7b099f09800f2 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-18/+13
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Beautifier: Add const wherever applicableLorenz Haas2015-06-231-2/+2
| | | | | Change-Id: Iba3e5793bfd0e4057074e2b04e6353ba09aa4a5f Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Consistently use qt5 connection styleLorenz Haas2015-06-221-5/+7
| | | | | Change-Id: Iea7a554dbb323b3a2b691d3e254c4e111897beb8 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Avoid raw loops wherever applicableLorenz Haas2015-06-221-12/+8
| | | | | Change-Id: I8b595ce0f7b3544466c6308457bf22826d1dafeb Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Beautifier: Support formatting specific lines of file with UncrustifyLorenz Haas2015-06-151-19/+34
| | | | | | | | | | It's now possible to format only a specific range of the current file. The used tool, however, needs to support the formatting of fragments like Uncrustify does with --frag. Change-Id: I486a350b6301e4a087619b1e225f2a5c553ff7df Reviewed-by: Jochen Becher <jochen_becher@gmx.de> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Fix untranslated messagesSergey Belyashov2015-05-191-1/+1
| | | | | | | Change-Id: I21ff7f3f70116944ba08ea18bdeeb258c0984f09 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Clean exported headers of the Core plugin.Friedemann Kleint2015-03-051-0/+1
| | | | | Change-Id: I26472d568844d5fee62323e01f5c5c12082d5450 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'Eike Ziller2015-02-121-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/tooltip/tipcontents.cpp src/libs/utils/tooltip/tipcontents.h src/plugins/android/androiddeployqtstep.cpp src/plugins/baremetal/baremetalconstants.h src/plugins/baremetal/baremetaldevice.cpp src/plugins/baremetal/baremetaldevice.h src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp src/plugins/baremetal/baremetaldeviceconfigurationwidget.h src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h src/plugins/baremetal/baremetalplugin.cpp src/plugins/baremetal/baremetalplugin.h src/plugins/baremetal/baremetalruncontrolfactory.cpp src/plugins/baremetal/baremetalruncontrolfactory.h src/plugins/cppeditor/cppcodemodelinspectordialog.cpp src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppdoxygen_test.h src/plugins/debugger/breakpointmarker.cpp src/plugins/debugger/debuggeritemmodel.cpp src/plugins/debugger/debuggeritemmodel.h src/plugins/debugger/loadcoredialog.cpp src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp src/plugins/projectexplorer/addnewmodel.cpp src/plugins/projectexplorer/addnewmodel.h src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp src/plugins/qmlprofiler/abstracttimelinemodel.cpp src/plugins/qmlprofiler/abstracttimelinemodel.h src/plugins/qmlprofiler/notesmodel.cpp src/plugins/qmlprofiler/qml/CategoryLabel.qml src/plugins/qmlprofiler/qml/MainView.qml src/plugins/qmlprofiler/qml/Overview.js src/plugins/qmlprofiler/qml/Overview.qml src/plugins/qmlprofiler/qml/TimeDisplay.qml src/plugins/qmlprofiler/qml/TimeMarks.qml src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp src/plugins/qmlprofiler/sortedtimelinemodel.cpp src/plugins/qmlprofiler/sortedtimelinemodel.h src/plugins/qmlprofiler/timelinemodelaggregator.cpp src/plugins/qmlprofiler/timelinemodelaggregator.h src/plugins/qmlprofiler/timelinerenderer.cpp src/plugins/qmlprofiler/timelinerenderer.h src/plugins/qmlprojectmanager/QmlProjectManager.json.in src/plugins/texteditor/findinfiles.cpp src/plugins/vcsbase/vcsconfigurationpage.cpp src/shared/qbs src/shared/scriptwrapper/interface_wrap_helpers.h src/shared/scriptwrapper/wrap_helpers.h tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp tests/system/suite_debugger/tst_debug_empty_main/test.py tests/system/suite_debugger/tst_qml_js_console/test.py tests/system/suite_debugger/tst_qml_locals/test.py Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
| * Update LicenseEike Ziller2015-01-161-6/+6
| | | | | | | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | Use new qt5 connect apiMontel Laurent2015-01-291-1/+1
| | | | | | | | | | Change-Id: I6c0d4ec60759b3c2fedac3e6649b7ec5102a6487 Reviewed-by: hjk <hjk@theqtcompany.com>
* | Core: Use FileName for file path in IDocumentOrgad Shaneh2015-01-121-1/+1
| | | | | | | | | | Change-Id: I85f7398aee59d0d36f0e5c3bf88ff3c96002e394 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* | TextEditor: Shuffle some convenience functionshjk2014-11-251-10/+7
|/ | | | | | | Remove rarely used ones, add a currentTextEditorWidget() Change-Id: I27b97c17927c71e07dc3b489785b7f2f76eb801e Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Normalize connect()sRobert Loehning2014-10-211-1/+1
| | | | | Change-Id: I27fee97c2837210d91948cc02f56cc5f6e6b19a2 Reviewed-by: Daniel Teske <daniel.teske@digia.com>