Commit Graph

458 Commits

Author SHA1 Message Date
Eike Ziller
30d048a256 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cppeditor/cppfilesettingspage.cpp
	src/plugins/haskell/haskellplugin.h

Change-Id: I880693c2e4986853b7aa600a5b7d6c09ad14634e
2024-01-30 09:19:06 +01:00
hjk
2c78f260d4 Fix some compler warnings
1x warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
2x warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]

Change-Id: I762fbe935156de9600064512bc405c6f4b2b1477
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-22 15:38:02 +00:00
Eike Ziller
b37cd984db Merge remote-tracking branch 'origin/12.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: I937d301156dac0d20b43e7a14b41a319eff57698
2023-12-19 10:55:55 +01:00
Christian Stenger
309d238f7b FakeVim: Persist fakevim settings when enabling globally
Explicitly persist settings if enable FakeVim mode gets triggered
using the global shortcuts, otherwise we would enable the FakeVim
mode only temporarily and a restart of Qt Creator would use the
former mode again.

Fixes: QTCREATORBUG-29949
Change-Id: I457b32f8e5fe035e334ed51f358f374c85ab010b
Reviewed-by: hjk <hjk@qt.io>
2023-12-15 08:04:03 +00:00
Eike Ziller
36d00b8a55 FakeVim: Test build without tests
Undefined symbols: FakeVim::Internal::createFakeVimTester

Change-Id: I2acaeaeb6a3be84ecc95415cd6f20296c4913786
Reviewed-by: hjk <hjk@qt.io>
2023-11-22 07:43:23 +00:00
hjk
01cecddce7 FakeVim: Fix warning about unused lambda capture
Change-Id: I136f52002e02611d41a309809408bcde57aceefe
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-20 10:22:59 +00:00
hjk
3b05a6f58e FakeVim: Merge Plugin and PluginPrivate classes
There were different from the PluginPrivate-created-in-initialize
pattern anyway.

Change-Id: I690c9c0511203f3c4d6ec9eeca85c0a277330e2f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-17 16:48:46 +00:00
hjk
bde92e035e FakeVim: Move plugin class definition to .cpp
Change-Id: Iac485bbd6cd00ddfae189a6f82c9f5f2c7e9aaf9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-17 16:47:38 +00:00
hjk
d1aaebc3b4 FakeVim: Move test declaration from plugin to separate object
Also ugly, but differently.

Change-Id: I832ac19c7d8a3457a40baaae60653a02a32dbd75
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-17 16:36:19 +00:00
hjk
9ef557e7ac FakeVim: Simplify completion support setup
That's the "word based" completion triggered by Ctrl-N.

Change-Id: Ib35d7e6d2fa0fc144cd92d09d22c279d50aa2fdc
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-16 13:55:28 +00:00
hjk
60d1fe4cb7 All: Even less #include <QSettings>
Change-Id: Ifbb2af34169036236e6f2f7b09ef115de5c6a6c7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 14:10:07 +00:00
hjk
342e066886 Utils, all: Standardize on QtcSettings
Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 13:25:31 +00:00
Jarek Kobus
aa016cc5a7 Various Plugins: Add context object into connections
Change-Id: I360677bebfef16a3233b3b8177cff6da57ec7c31
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-02 08:55:37 +00:00
Eike Ziller
355e8d133c Fix some warnings about unused things
Change-Id: I42bb514dfe1d6745b1469b508a4cfa576e17c31b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-25 07:26:58 +00:00
hjk
2c512625c5 FakeVim: Delay settings creation until actual use
Task-number: QTCREATORBUG-29167
Change-Id: I3a6f1330922f3840cb7e99d8adb60a728d36eb4b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-10 10:31:14 +00:00
hjk
2f7ecdaf06 FakeVim: Use a FilePathAspect for .vimrc
Even if it's not used as such, it would be the right thing to use.

Change-Id: I7f8931b581af6a97231c49c20e7adc56ad2efff6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-30 09:47:40 +00:00
hjk
379e7f906e Utils: Rework aspect implementation
This avoids some repetition and could be a step towards
having type storage in (or rather accessible from) the base,
so we can have aspects for more complex data (treemodels...)
that are not easily converted to QVariant.

Change-Id: I9797b3d5646195705212db1830d2b415291ac651
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-29 11:25:44 +00:00
Christian Kandeler
cf6bd7e012 Fix occurrences of the contains/insert anti-pattern
Introduce and make use of Utils::insert() for QSet with a return value
that indicates whether insertion actually happened.

Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-23 09:51:54 +00:00
hjk
db4dd91caf FakeVim: Streamline settings handling a bit
Change-Id: I6ab2c1643a5236525515ded296cd854933584603
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-06-01 15:33:59 +00:00
hjk
5c5624007b FakeVim: Use PagedSettings for main settings
Change-Id: I5029ae42ca5c3ec426d37a818150677186dd55ea
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-06-01 09:41:34 +00:00
hjk
5ad790d5c8 FakeVim: Maintain highlighting on split
Fixes: QTCREATORBUG-28914
Change-Id: I4e0b82e49bd97f19eb513f21e1dc405ea9f0700c
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-17 13:24:41 +00:00
David Schulz
fe74e6d43b FakeVim: only block suggestion when fakevim is in use
This fixes the issue that no copilot suggestion were shown after
switching documents.

Change-Id: Ic81bfbe266877964eeaf688d9915a7937607118b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-15 09:28:40 +00:00
hjk
c85b72000f All: Use the shorter access to aspect values in a few places
Change-Id: Ie0ff0e4e1cf4c2750897ea733dfccb743f44fa93
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-12 16:04:38 +00:00
hjk
7581dcd369 FakeVim: More compact settings page implementation
Change-Id: Iaca48e8a22f26817442dbf5147f318868dbd1f34
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-05 14:29:13 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Alessandro Portale
e5051bbfde Layouts: Add/remove contentMargins where needed
Some cases were preexisting, some were introduced recently

Change-Id: I0e7e7b74422c420fbf4563d7cbf384e53931c3a0
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:38:33 +00:00
hjk
c3a213cc65 FakeVim: Remove QtcProcess use from fakevimhandler.cpp
fakevimhandler.{h,cpp} are meant to be re-usable outside of Qt Creator.

Amends 91605c3.

Change-Id: I569a393d13049ef92ed3ef0c4f69de5232b2fa32
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-02 07:45:43 +00:00
Marcus Tillmanns
015d12ccf3 FakeVim: Accept suggestion with Tab Key
* Changed signals to callbacks as only one receiver was ever added
* Added "tabPressedInInsertMode" callback to allow accepting
  a suggestion with the Tab Key

Fixes: QTCREATORBUG-28830
Change-Id: Ie70ba595b8802b6100fff495164d8e0471b1354c
Reviewed-by: hjk <hjk@qt.io>
2023-05-02 06:53:54 +00:00
Marcus Tillmanns
9f0919c4a3 FakeVim: Block Suggestions
Block suggestions when FakeVim is enabled and the mode
is not "Insert" or "Replace".

Change-Id: I778eb25d9570b76e42652f9d938a8c580033c462
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-05-02 06:04:53 +00:00
Marcus Tillmanns
1a658eff26 FakeVim: Clear suggestions on mode change
Change-Id: I5d3a37ab61f83a70e055063de397654f5621401d
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-04-27 06:56:47 +00:00
Christian Stenger
a5e5058c41 FakeVim: Avoid using invalid regular expressions
Print a warning in case of an invalid regular expression
and do not apply it to the settings.
This silently drops invalid regular expressions entered
and restored from settings.

Change-Id: I2f7686066541cf2307cf7cf96b3c6f89f6a677d8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-27 05:15:02 +00:00
hjk
c2ea7bc415 FakeVim: Re-organize ExCommand settings page setup
Change-Id: I085a86529fc840472aabf7ae62d6565f454256ae
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-25 08:35:45 +00:00
hjk
d13d48a281 FakeVim: Use IOptionPage::setWidgetCreator() for user command settings
Change-Id: Ic5d895634cb5ef1b2e1a6fa465cd800a213a7d41
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-04-25 08:12:05 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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>
2023-01-06 11:15:13 +00:00
David Schulz
0e4b0a26d3 Editor: move ownership of assist interface to processor
This way the base class can manage the lifetime of the interface object
and it doesn't need to be done in each implementation of perform.

Change-Id: Ie1ce742e31b688a337533ee6c57d376146e25ace
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-17 13:23:55 +00:00
David Schulz
09ee528c40 Editor: unify assist processor handling
Define the run type of the processor by its implementation instead of a
enum value of the provider. The execution of a processor inside the
assist now follows a unified procedure.

Change-Id: Ibe9fab324c6072e77702c2663946d7a9f562a085
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-14 13:02:51 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
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>
2022-10-07 13:47:53 +00:00
Jarek Kobus
392585f76d FakeVim: Replace foreach with ranged for loop
Change-Id: I0de9620ebf837be25e153bfd282b6564d4d2b115
Reviewed-by: hjk <hjk@qt.io>
2022-10-05 13:50:35 +00:00
Florian Koch
69fad91660 Re-introduction of the feature to adjust the line spacing
This already has been implemented in change
dc64f3207b, but was reverted with
change f220cb0e23) because this does not
work with text wrapping rendering, due to internal limitations of Qt.
Since this is a highly requested feature (e.g. QTCREATORBUG-13727), but
an internal change within Qt is not in sight, the approach taken here
is to offer the text wrapping feature in the settings only when the
line spacing is set to 100%. Additionally, a change has been made to
the layout of the display settings page to reflect this.

Fixes: QTCREATORBUG-13727
Change-Id: Ib233cf90a5f336bc591fa1bf860e162fa774dfe3
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-09-12 16:40:15 +00:00
Eike Ziller
04e50438eb Utils: Remove Utils::optional
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>
2022-09-01 06:58:04 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
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>
2022-08-26 12:27:18 +00:00
hjk
58c5b126d3 Utils: Settle on lowerSnakeCase for LayoutBuilder::Setter
Change-Id: Icfe487d8c7712cc8ad28f0f61e8ae4778a356fc3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-27 08:40:12 +00:00
hjk
b97c495d2b Utils: Make the second parameter to LayoutBuilder::attach() an enum
More explicit and more potential options (e.g. "treat grid as form")
than a bool.

Change-Id: I89413efe30410160c38b0e524ba64288dde2332e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-26 11:52:16 +00:00
hjk
14257a24f9 Utils: Introduce Layouting::{br,st}
... as "standard" ways to define line breaks and simple stretch.

There have already been too many patterns to do it.

Break() and Stretch() still work for the patches in flight, but
they are planned to be removed.

Change-Id: I9b70dcdc11244a904a496b0c55938dfb0b265fc8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-25 09:52:15 +00:00
hjk
b8a6d72137 Utils: Make Layouting::Group { .. } less weird
It had a implicit vertical layout leading to unneded layout nesting
in quite a few cases. The price is an added Column { ... } in those
places where the implicit vertical layout was sufficient before.

Change-Id: I3ae1f03f9c1d691bd0c563b0447edd03ee02bbd2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-22 07:43:23 +00:00
Eike Ziller
b6dcca00c9 FakeVim: Fix compiler warning
Remove unused lambda capture

Change-Id: I973a5a6be6e2c27450ab80bbb87c9077f0ecd3e9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-19 07:51:16 +00:00
Robert Löhning
7c942cfd18 Remove outdated code
Change-Id: I65e0ed79dabd987bc67d4082969835d52dd7cb8b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-09 18:53:36 +00:00
Eike Ziller
195abefe7d EditorManager: Remove QString openEditor(At) overloads
In favor of the FilePath/Link ones.

Change-Id: I5caf9e0f8de304ff4ee12329557aa50a6f3a0c69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-02 08:11:14 +00:00