Commit Graph

592 Commits

Author SHA1 Message Date
Eike Ziller
363d2d161c Merge remote-tracking branch 'origin/12.0'
Change-Id: I35cb28b759fb200c45a1496299584132336fcd1c
2023-11-08 10:07:29 +01:00
David Schulz
4a081cb386 TextEditor: remove texteditor_p.h
There is no need to have an extra file for one struct that is only used
inside texteditor.cpp

Change-Id: Iee8f7ce5e0d19da7b444660d81c350eb10b501ef
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 15:24:57 +00:00
Eike Ziller
df80454d26 Merge remote-tracking branch 'origin/12.0'
Change-Id: I04104ef638b28d99da11b9b7a22f31f8d0ddf460
2023-10-24 13:05:55 +02:00
David Schulz
2e93051aaf TextEditor: improve sort selected lines
Try to get a sensible scope when there is no selection when sorting
lines.

Use the indent level of the current block and select all blocks that are
not empty with the same indent level around that block before sorting
the lines.

Change-Id: I68cbd95f95a0cc4425a0339b992225c3946a6858
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-10-24 07:38:38 +00:00
David Schulz
6f4b9639ce TextEditor: highlight selected text
Change-Id: Ib46908decef51d478f6954a116108c48e4a07ed3
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-10-23 07:33:45 +00:00
Leena Miettinen
61088bba69 Fix UI text capitalization, punctuation, and phrasing
Change-Id: I41951660a464601063e5cedd417db2cb7cd37e44
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 14:55:38 +00:00
David Schulz
5f45c36b6f TextEditor: do not scroll to cursor postion on select all
Since Qt 6.5.1 QPlainTextEdit::selectAll emits correctly
cursorPositionChanged on selectAll which calls some multitextcursor
update code on our side. Avoid setting the cursor back to the
QPlainTextEdit in this update code by setting the expected
MultiTextCursor before calling selectAll.

Fixes: QTCREATORBUG-29763
Change-Id: I77f05ac40a9dd126efcd72089a699c908c68da21
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-20 10:47:34 +00:00
Eike Ziller
a253a2aa95 Tr: Fix lupdate issues
Add missing `Tr::` and use some fully qualified namespaces where lupdate
fails to resolve it correctly.

Change-Id: Ied4ac7bf0438a9080d0b76a9a1f5033dbc94a163
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-10-18 11:21:52 +00:00
Marcus Tillmanns
fdeff13ca3 TextEditor: Don't export KSyntaxHighlighting
Change-Id: I84fa8c758af412d8847391a628deac60279b9448
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-10-17 13:25:50 +00:00
Marcus Tillmanns
d8a75d48a3 TextEditor: Add selecting highlighter by name
Change-Id: I5c706dd151173bf08c5fbd4dacbf6e5d6416b87b
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-10-17 08:47:45 +00:00
David Schulz
483a340e73 TextEditor: speed up searching in huge documents
Avoid creating QTextCursors for checking whether a search result is
inside the find scope. QTextCursor::setPosition seems to layout the
block the cursor is positioned at, which is not for free and not needed
to verify whether a search result is inside the find scope.

Change-Id: Ia1658fbbaa89a61f862e0b97eaa5b059972e2311
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-13 11:37:29 +00:00
David Schulz
eda0dbd8dd TextEditor: modernize highlighting search results
Change-Id: I365a09dfd9d371119044da5567a1adb397f3ac93
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-10-12 07:58:49 +00:00
David Schulz
80633a59aa LanguageClient: support additional goto targets in symbol support
Allow to follow to the symbol definition as well as to the type
definition for the symbol under the cursor position.

Change-Id: I8ff50b33a1e739f81b0832b1b28ffc525e1f7177
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-29 09:10:14 +00:00
David Schulz
7c28cc0565 Editor: transform the encoding label into button
Like for the line number label: Having a button instead of a labal makes
it more obvious that there is an action triggered when clicking the
label.

Change-Id: Ied15c05658c0b0b7df75cbcf1704808e94f6985d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-22 09:00:24 +00:00
David Schulz
0a323274d4 Editor: transform the line column label into button
Having a button instead of a labal makes it more obvious that there is
an action triggered when clicking the label.

Also fix the flickering introduced by
f0bb7e8bfa by saving the maximum width of
the sizeHint. Since the width can get big if we have a selection we do
not save the size in that case to avoid blocking the width when the
selection is removed again.

Change-Id: If8210ecbabb8c6449c4f88652fbed99f8526057d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-22 08:33:36 +00:00
David Schulz
9a0f61b7e2 TextEditor: reduce size of line ending chooser
Change-Id: I3be0890ee78e2e3159e1494f8b5e972e04f11f67
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-19 08:58:41 +00:00
Christian Kandeler
18372ca553 TextEditor: Do not make one-letter doxygen commands end a rewrap region
In 8e118e9d5e, we stopped re-wrapping in
comments when a doxygen/qdoc command appeared at the start of the line.
However, there are also "inline" commands such as \l and \c that can by
chance appear on the start of a line and should not stop rewrapping.
Since we are still quite reluctant to enumerate and categorize the
countless doxygen/qdoc commands, let's just ignore all one-letter
commands for rewrapping purposes.
(Yes, this is another hacky heuristic.)

Fixes: QTCREATORBUG-28761
Change-Id: I40d77706851ec24504d6fd8795906dd55249661d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-09-18 09:18:02 +00:00
David Schulz
aab39532f3 TextEditor: Collect the comment position setting from highlighter
Change-Id: I802b9e263a3515fe340459329a8c8d8f309cfa0e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-09-15 10:50:44 +00:00
Xavier BESSON
5cfe69ea1e Add possibility to comment selection after the white spaces
Fixes: QTCREATORBUG-29410
Change-Id: I736378e0b5fb542a6c1032a47adfb251b50ce2ef
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-14 06:59:00 +00:00
David Schulz
28742774fe TextEditor: add rename symbol option to editor context menu
... if the action handler supports the rename option.

Change-Id: Ic1bad19a490aaccc8e96afd1f74741596bf6efc3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-28 07:52:52 +00:00
David Schulz
b128c585d9 TextEditor: render suggestion with the tab width of the editor
Fixes: QTCREATORBUG-29483
Change-Id: Id8da019130055ce40bd639d038eb1e74d9787884
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-10 13:37:33 +00:00
Christian Kandeler
099fe7d5d1 CppEditor: Let users fold/unfold all comment blocks
Fixes: QTCREATORBUG-2449
Change-Id: Ib090f1bb0d0866f14ddb6dfb10bf2ff2563585e0
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-08 08:52:55 +00:00
David Schulz
f0bb7e8bfa Editor: modernize line column label
This change contains various adjustments to the line column label:
 - Display the number of selected characters
 - Show the number of cursors instead of the position when multiple text
cursors are present in the current editor
 - show detailed information for each cursor in the line column tooltip

Fixes: QTCREATORBUG-29381
Change-Id: Ib4f36b290797f1d84f268deeb9556e78ae921c37
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2023-07-07 11:23:49 +00:00
David Schulz
b721d98476 Editor: optimize annotation cache cleanup
Looking up the last visible block is not for free since it calculates
the bounding rects for all blocks between the first and last visible
block. Avoid one calculation by postponing the annotation cleanup after
the paint event and only if we reach a certain amount of cached entries.

Change-Id: Ibfab49301f82237e16d5a69ce1531539907e7ed8
Reviewed-by: hjk <hjk@qt.io>
2023-07-04 06:41:09 +00:00
Eike Ziller
26e96bfad8 Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/debugger/debuggeritemmanager.cpp

Change-Id: I9d99d13feff9315f52eacbd84857c63cb69bf804
2023-07-03 10:24:09 +02:00
David Schulz
a207943f59 Editor: fix visual glitch after disabling overwrite mode
Change-Id: Ied85cf298a12a29cf448e6dec6c81f6a0a2dc4b7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-06-28 12:35:35 +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
Eike Ziller
6c601b8cd4 Merge remote-tracking branch 'origin/11.0'
Change-Id: I8d1c9720a868da02b3157a48954eb4e262539c84
2023-06-15 09:48:58 +02:00
David Schulz
827d6e66f8 Editor: only paint the preedit cursor
Task-number: QTCREATORBUG-29134
Change-Id: Ia44b0c8ddc88da7b64527fea806139726d57243a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-06-14 10:05:16 +00:00
Eike Ziller
e7870f736d Merge remote-tracking branch 'origin/11.0'
Conflicts:
	src/plugins/clangformat/clangformatutils.cpp

Change-Id: Ide285cc25fca9101843ab9dca01c5a33644aca7f
2023-06-14 08:43:08 +02:00
David Schulz
37433c1897 Editor: do not set the viewport margins if they have not changed
Change-Id: I01adabc52e47e8a47aff0f5dc2b580066e51307c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-14 04:58:49 +00:00
David Schulz
c547c8615f TextEditor: optimize setting refactor markers
emitting requestBlockUpdate is not for free so limitting it to blocks
that have changed improve the performance notable for documents with a
lot of refactoring markers.

Change-Id: Ie288a367d1d1d6a9f4359e37ff8486a1dfe36752
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-06-13 11:52:00 +00:00
David Schulz
4481686909 TextEditor: improve performance of painting indent depth
Avoid asking the indenter for the visual indent depth since some
implementations are not cheap and might even cause file io. Fall back to
the default detection.

Change-Id: Ic85d134fc29a0599768ac05c306b8593e83db327
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2023-06-13 09:05:21 +00:00
Eike Ziller
375db16ac4 Merge remote-tracking branch 'origin/11.0'
Change-Id: I87b22a73427cf9fc1b96075dc0db769ed3d3621c
2023-06-09 11:24:29 +02:00
Jarek Kobus
abb85b073a QScopeGuard: Make all usages of QScopeGuard consistent
Change-Id: Icfc35ecbdbdee8dadbb1b17789694093427c3ed9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-07 10:35:01 +00:00
Eike Ziller
967c53696c Merge remote-tracking branch 'origin/11.0'
Conflicts:
	tests/manual/subdirfileiterator/tst_subdirfileiterator.cpp

Change-Id: I6fa8fbed152efc4033fa69e1ab67ced7e2ad35bc
2023-06-06 16:50:22 +02:00
Jarek Kobus
b14c07eed6 TextEditor: Reuse qScopeGuard instead of ExecuteOnDestruction
Change-Id: I2ca7d4676bb4f34fbf59fd45bcd01d7857cb7e4e
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-05 08:35:14 +00:00
Jarek Kobus
bd48121a88 TextEditor: Reuse searchInContents()
Change-Id: I08403d05830232becf7e5329339aaecf288894b7
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-30 08:22:32 +00:00
Jarek Kobus
a78720060e FindFlags: Move it into Utils lib
It's going to be reused in filesearch.h API.

Change-Id: I7ef133368536a647e19949ba8623134cf078a87d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-26 07:59:41 +00:00
David Schulz
9bb126c0d6 Utils: make column of convertPosition 0-based to merge it into Position
Change-Id: I239b3cb33b8ad59ac4097c919155ab5ca7d57b8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-24 11:53:28 +00:00
Tim Jenssen
1b6c0ff56c Merge remote-tracking branch 'origin/qds/dev'
Conflicts:
  coin/instructions/build.yaml
  doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc
  share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl
  src/libs/CMakeLists.txt
  src/libs/advanceddockingsystem/dockmanager.cpp
  src/libs/advanceddockingsystem/workspacedialog.cpp
  src/plugins/coreplugin/manhattanstyle.cpp
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmldesigner/components/formeditor/toolbox.cpp
  src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp
  src/plugins/qmldesigner/components/toolbar/toolbarbackend.cpp
  src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h
  src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp
  src/plugins/qmldesignerbase/qmldesignerbaseplugin.cpp
  src/plugins/qmldesignerbase/qmldesignerbaseplugin.h
  src/plugins/qmlprojectmanager/qmlproject.cpp
  src/tools/qml2puppet/CMakeLists.txt
  tests/unit/unittest/CMakeLists.txt

Change-Id: I2c5f18c4fca49471d02713ce5859032232cf7756
2023-05-22 21:13:40 +02:00
David Schulz
3f2832289d Utils: move TextPosition/Range to textutils
Change-Id: Id94a7a96f3b0f978e94850d67eb4b8fba6c18fe2
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-10 09:32:39 +00:00
Jarek Kobus
936086745a FileSearch: Get rid of FileSearchResult
Use SearchResultItem instead.
This change should reduce the remaining freeze described in
a9eb732ce6 even more.

Change-Id: I102b82ed5677360ccd9e425dd0bdd941d87116f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-09 11:03:48 +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
Tim Jenßen
9c2a73b1c8 Merge remote-tracking branch 'origin/10.0' into qds/dev
Change-Id: I51801c3bec7e29f7c7384d86d79b4fcabb4f99c1
2023-04-27 20:30:00 +02:00
Eike Ziller
c9696fbabb Merge remote-tracking branch 'origin/10.0'
Change-Id: I8b36c1812b61dbe08fe3e7930f950e6b8e8a7079
2023-04-24 08:52:35 +02:00
Eike Ziller
5125ccf03f Merge remote-tracking branch 'origin/9.0' into 10.0
Change-Id: Ifbb14e33104b39de8ca2e1495301a53e71496ef9
2023-04-24 08:10:39 +02:00
Ali Kianian
151423ab16 QmlDesigner: Remove transient scrollbars
The concept of the transient scrollbar still exists, but all used cases
are removed.

Task-number: QDS-9735
Change-Id: I16c57635a5eeb114b906ab74bbf24a8693897557
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-04-21 05:21:20 +00:00
Thiago Macieira
d1d893f098 Fix dangling references, found by GCC 13
Lifetime extension via const-ref only applies to functions that return
by value. For those that already return by reference (such as
QList::constLast()), no extension happens and we end up with a dangling
reference.

cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference]
cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList<ProjectExplorer::BuildStep*>::constLast()’

Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-04-20 14:29:31 +00:00
Marco Bubke
79b5a9f03e TextEditor: Return BaseTextEditor for duplicate
Because the type is always a BaseTextEditor we can return a
BaseTextEditor type. C++ is allowing to change the overload return type
so long it is compatible.

Change-Id: Ib4c88faaa6fdfb97fd03c51a120de0fa0c2d00cd
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-19 10:17:56 +00:00