summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/snippets
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Make Layouting a top level namespacehjk2023-04-251-1/+1
| | | | | | | | | | The whole machinery is now almost only layoutbuilder.{h,cpp}, mostly independent of the rest of Utils. Idea is to finish the separation to make it stand-alone usable also outside creator. Change-Id: I958aa667d17ae26b21209f22412309c5307a579c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* TextEditor: Use IOptionPage::setWidgetCreator() for snippets settingshjk2023-04-213-137/+83
| | | | | Change-Id: I9aa91edef20f325f1a2fc93388aecb5776b970d6 Reviewed-by: David Schulz <david.schulz@qt.io>
* C++ editor: Make generated Q_PROPERTYs FINAL by defaultUlf Hermann2023-04-201-2/+2
| | | | | | | | | It's bad style to omit the FINAL because such properties can be shadowed, causing problems in QML. Change-Id: I9083c69128f6335f584f0a1d28f1fe1e54a02eaf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Translations: Replace QCoreApplication::translate() with Tr::tr()Alessandro Portale2023-02-101-1/+1
| | | | | | | | | Calling <Module>::Tr::tr() is preferred over QCoreApplication::translate("::<Module>", "..."). This changes occurrences in .cpp files. Change-Id: I3311ef0dbf3e7d105a3f181b6b988f3b444468f1 Reviewed-by: hjk <hjk@qt.io>
* TextEditor: Tr::trhjk2023-01-184-32/+41
| | | | | | Change-Id: I28aa68e25c53c3a4d1c370074d7b3318944dc45a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Prefix Tr::tr contexts with ::hjk2023-01-131-1/+1
| | | | | | | To make outliers better visible in Linguist Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-0619-19/+19
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/9.0'Eike Ziller2023-01-051-0/+5
|\ | | | | | | | | | | | | Conflicts: src/plugins/qtsupport/qtoptionspage.cpp Change-Id: Ic8ada9fd47f5eb62e751b6188a45b95ddb36122d
| * Editor: fix crashing on updating snippet selectionsDavid Schulz2023-01-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | The final selection is not tracked in m_selections and needs to be handled explicitly. Also add an assert preventing unconditionally accessing an out of bounds element of m_selections. Fixes: QTCREATORBUG-28631 Change-Id: I1898418b1126bdaffccbdf0e483e2c659d191917 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Don't call non-const methods on temporary QListJarek Kobus2022-12-081-2/+2
|/ | | | | | | | Otherwise it may unnecessarily detach. Either store a local const reference or call const equivalent (e.g. constFirst()). Change-Id: I96d665487cf28c17e72bea17f1b8f164ce06cc70 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-072-3/+3
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-2619-456/+38
| | | | | | | | | 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>
* Utils: Remove variant.hMarco Bubke2022-08-232-8/+9
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local copy of std::variant and use for macOS std::variant too. Change-Id: I589d03b35fc56878b7392ffa7047a439e588fe43 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: inline snippetssettingspage.uiAlessandro Portale2022-08-172-180/+76
| | | | | | Change-Id: I483bc07b39328a491af373ce76b365e968176828 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Drop Qt5: Cpp/TextEditor: Get rid of QOverloadJarek Kobus2022-07-261-1/+1
| | | | | | Change-Id: I010f211b40f876c0f033fd717aaa094f775ea214 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: More forward declarations / drop unused headers [T-Z]Jarek Kobus2022-05-251-0/+1
| | | | | | | | | | | Round 1 - focus on headers. For classes with initial in range [T-Z]. Replace QT_FORWARD_DECLARE_CLASS with QT_BEGIN_NAMESPACE and QT_END_NAMESPACE and forward declare inside. Change-Id: I4ac3a8391e6167aa2db3973a9f94a45ac3c8ebd1 Reviewed-by: hjk <hjk@qt.io>
* Fix context menu of snippet editorEike Ziller2022-03-162-0/+6
| | | | | | | | | | | The snippet editor is a TextEditorWidget, but the special context menu of that doesn't make sense in the context of the snippet settings. Get the default context menu back. Fixes: QTCREATORBUG-27176 Change-Id: I9681482f83fe32d15be0b1386e2fb26870b955e2 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Wrap various file system iteration flags and filtershjk2022-01-261-1/+2
| | | | | | | | | | | ... into a single class. This makes passing them around as a whole easier, and opens a path to have "generic" filters in form of a lambda or such. Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/6.0'Eike Ziller2021-12-092-27/+34
|\ | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri Change-Id: I32991a77e52831dd2e24cf4a51ec252998c2d743
| * TextEditor: Fix compile with Qt 5Christian Stenger2021-12-062-11/+12
| | | | | | | | | | | | | | | | | | Amends 8d08196a2118433. Change-Id: I8f67ee0549c621d168bacb57cd4ce0ad226cf852 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * Fix crash when removing built-in snippetsEike Ziller2021-12-062-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Snippets collection managed the snippets with persistent iterators to the "end" of the active snippets. Qt 5's QList was nicely updating iterators even on non-const operations, but that has changed in Qt 6. Don't use iterators, simply work with the count of active items. Fixes: QTCREATORBUG-26648 Task-number: QTCREATORBUG-24098 Change-Id: Icc13274daf0e87d0562d80d7bc763c863d5da075 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Schulz <david.schulz@qt.io>
* | Make some qHash and comparison operators overloads hidden friendshjk2021-12-061-6/+5
|/ | | | | | | Restricts lookup scope more to necessary bits. Change-Id: Ia42c95aaa70534843b7f6a90bfc56d2a1202c612 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Editor: Fix crash when select last snippetDavid Schulz2021-10-141-4/+4
| | | | | | | | The first variable index might not be zero. Fixes: QTCREATORBUG-26406 Change-Id: I54a9575da61d770ba82f3ddb9b1e8b0128ae51dd Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Modernize SnippetsCollectionhjk2021-08-192-47/+36
| | | | | | | More FilePath use, foreach, less .h exposure. Change-Id: Ie24324b33333733736f0cd12c7637798fc88aa34 Reviewed-by: David Schulz <david.schulz@qt.io>
* Text Editor: Fix UI textLeena Miettinen2021-07-051-3/+3
| | | | | | Task-number: QTCREATORBUG-25915 Change-Id: Ibc760268640ee77d8c2f95f92fee46f46408f75d Reviewed-by: David Schulz <david.schulz@qt.io>
* Editor: merge SnippetOverlay::mangle, ::clear and ::hideDavid Schulz2021-06-112-2/+4
| | | | | | | | ... into SnippetOverlay::accept. We currently have no need for just applying the mangling without closing the overlay. Change-Id: I98b2f023253f3676d1aed21438251998be1e509c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Snippets: Allow defining a final snippet tabstopDavid Schulz2021-05-283-1/+27
| | | | | Change-Id: I8b9704f66c9f0ac33dfb9d8f5e970a85bbcf143e Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Editor: Allow defining custom snippet parser functionDavid Schulz2021-05-254-54/+119
| | | | | | Task-number: QTCREATORBUG-22406 Change-Id: I21ae9740d348d4e0869029343d51b70f9df9cdac Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: filepathify fileutilsDavid Schulz2021-05-181-1/+1
| | | | | Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: Fix snippet variable index overflowDavid Schulz2021-05-041-1/+1
| | | | | Change-Id: Ifd224c33d5ffe56e22b85d8c1959448154d550b1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: Fix compile with Qt6Christian Stenger2021-05-041-10/+7
| | | | | | | | toStdList() has been removed in Qt6. Amends a2dadb3d0bf4f8850cc0da. Change-Id: Id2032d7e0a0c3345614bc56d98152c41f199af07 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: Snippet ranges refactoringDavid Schulz2021-05-034-233/+294
| | | | | | | | | | | | | | | Parsed snippets are now reported in chunks of texts and variables. A variable has a index that can be used to identify matching variables and maybe a mangler that can be used to modify the variable when applying the snippet. This effictively moves the variable matching logic from the overlay to the parser of the snippet, which is needed to implement the LSP snippet parser. Task-number: QTCREATORBUG-22406 Change-Id: I6999554c6c6d0f1887c98bf732473f01aa1f230c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: move snippet overlay into own cpp fileDavid Schulz2021-05-032-0/+166
| | | | | Change-Id: I3343d9abf19e4edc7bd88077bf8fe6666a901e1b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Fix missing includeChristian Stenger2021-04-281-0/+1
| | | | | | | Amends c8f8513c8da858d214. Change-Id: I5c82c2f91d71425e5333e0248582ee9fe4f2ee28 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Snippets: Split error messages out of the parsed snippetDavid Schulz2021-04-282-33/+62
| | | | | Change-Id: Ic5d6664c86405c558e8bb133b854521e4eaef58a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core: Add a default parameter to various ICore::*path functionshjk2021-04-271-1/+1
| | | | | | | | Saves some code on the user side. Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* TextEditor: move ParsedSnippet out of snippetDavid Schulz2021-04-262-20/+21
| | | | | Change-Id: I4e9c7d810fdd0904386f8d3b3481c0a4855c2021 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ICore: Change some path API to use FilePathEike Ziller2021-04-261-4/+4
| | | | | | Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Use qAsConst with non-const Qt containers in range-loopsAlessandro Portale2021-02-171-1/+1
| | | | | | | ... in various places Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Fix build with Qt6Eike Ziller2020-10-261-0/+1
| | | | | | | | | | | Add missing includes for "incomplete type" issues. Remove usage of QDesktopWidget. Don't compile native WebKit help backend (missing native widget integration). Add SvgWidget dependency. Task-number: QTCREATORBUG-24098 Change-Id: I1b3afb54d385940ff283824870fa7454866212a4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Snippet: show mangled replacements in snippets tooltipDavid Schulz2020-09-211-25/+53
| | | | | | Fixes: QTCREATORBUG-24317 Change-Id: Ibaeacc13f49a933836ccf9c906309219e3533564 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Editor: Validate trigger from snippets xmlDavid Schulz2020-08-144-16/+27
| | | | | | Fixes: QTCREATORBUG-24415 Change-Id: Ic99355220bf1948af8a17d6ce017924eba3fc3ba Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core/Utils: Migrate further to Utils::Idhjk2020-07-062-27/+23
| | | | | | | The coreplugin/id.h header is kept for downstream for now. Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Move Id from Core to UtilsEike Ziller2020-06-181-2/+2
| | | | | | | | | | | | | | | | And add a compatibility wrapper for Core::Id, so we don't have to rename all occurrences from Core::Id to Utils::Id. This allows us to use Id also in Utils, which makes it possible to e.g. move Core::InfoBar to Utils without work arounds. Change-Id: I5555d05b4e52f09d501dbfe5d91252a982a97c61 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* TextEditor: Partially apply new settings page patternhjk2020-01-212-18/+10
| | | | | | | | Internal handling is quite fragile in some cases, so take baby steps here. Change-Id: Ia25666b8c8d26b6e580d2189b191767b9681dc21 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Dissolve TextEditorOptionsPage intermediate hierarchy levelhjk2020-01-162-3/+6
| | | | | | | | It's effectively setting only three properties nowadays, not enough to justify a case of reuse-by-inheritance anymore. Change-Id: I947fbc51e76c8d908da662dd58dce91614c28e08 Reviewed-by: David Schulz <david.schulz@qt.io>
* Replace static_casts by QOverload where possiblehjk2019-02-261-1/+1
| | | | | | | | | Mainly to get rid of the QProcess::finished deprecation warning. Also adjust coding style in the surrounding connects when needed. Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: replace generic highlighter with ksyntaxhighlightingDavid Schulz2019-01-282-2/+2
| | | | | | Fixes: QTCREATORBUG-21029 Change-Id: I9894c4384e0e47da6bf030b7b8e07c3ad4737ff3 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* TextEditor: ModernizeAlessandro Portale2018-11-303-6/+4
| | | | | | | | modernize-* Change-Id: Ic497fea1942a77cf017be3b0033f92e3807066f1 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io>
* TextEditor: ModernizeOrgad Shaneh2018-09-204-16/+16
| | | | | | | override, auto, nullptr, member initializers. Change-Id: I04c6ebb683849568973bd7782fb5a3279267141e Reviewed-by: Eike Ziller <eike.ziller@qt.io>