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>
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>
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>
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>
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>
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>
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>
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>
- Transient scroll bar is available for StudioStyle.
- Some changes are applied to slider style, because scrollBar and
sliders have some common usages within the style.
Task-number: QDS-9283
Change-Id: I7a8b7997cf4d20142a0524c4a071b93dfd06321d
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
These tooltips allow to switch the currently visible suggestion as well
as applying it using
the mouse.
Change-Id: I30b9a76ae57c66887f4e1b1311e1a7248ed0f194
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
And also a copilot suggestion implementing that interface that allows
reverting all changes done to a suggestion as well as applying it.
Change-Id: I236c1fc5e5844d19ac606672af54e273e9c42e1c
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Fixes highlighting of matching parentheses or errors of the code model
in every line of the suggestion.
Change-Id: I223cb567ee8ce95badd91c4819417310a0e28cff
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This will make sure that code reacting on the document change signal can
get the final cursor position from the widget. More specificly this
fixes requesting copilot suggestions when automatic text is inserted
like closing parentheses when typing "if ("
Change-Id: I01a13e67e72b89010fe39de3d0def0622a9b08b8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
The use can still explicitly request completions in that case via the
keyboard shortcut.
Change-Id: I4ed47232a24288c540d1357c0f876a1cdfcfec08
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Blocks with suggestions are longer than without the suggestion. So we
have to calculate the annotation start position based on the reaplcement
and not the actual document layout.
Change-Id: I32ce81134e1146dd28ae11a70356a98c75529236
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
The painting of an editor assumes the block is layouted properly. This
was done implicitly when calculating the block bounding rect previously.
With the option to replace the block layout with another document this
is not the case anymore, so we need to explicitly make sure that a block
was layouted before painting.
Change-Id: If6947a3a5c13a03310e0cab0f6fcbd4ff8078b1b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Only update the changed blocks and use sets instead of lists to
store the info and create the diff.
Change-Id: I08d81b326ceebdc6bf2ba322886b7bf5671b2769
Reviewed-by: David Schulz <david.schulz@qt.io>
- Use map for merging intervals instead 2 times list iteration.
- Time complexity O(nlogn) instead O(n^2)
Change-Id: If65391999e1ff191752447935602fcc9847243fe
Reviewed-by: David Schulz <david.schulz@qt.io>
More inline with the other text block user data members and cleaner on
the client side. Additionally add some & for const arguments and remove
test function call.
Change-Id: I19e646aa204eedf447c02a2f76b89c3430280169
Reviewed-by: hjk <hjk@qt.io>
Since the find of QTextDocument is line based, it is not possible to
find selections spanning multiple lines in the editor. Triggering a find
on a search term containing a paragraph separator returnes an invalid
QTextCursor which always result in searching from the beginning of the
document in the add cursor for selection logic. Prevent that by checking
the selected text beforehand and add a safety net in the loop to verify
that we do not start over again on an invalid TextCursor.
Fixes: QTCREATORBUG-28709
Change-Id: I8c1b9d16e707fefbba6dc0a0a9ef21b8c82ebe19
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
The hiding is not persistent, so on the next Qt Creator start all
annotations are visible again. This is meant to quickly get rid of
annotations if there are to many irrelevant of a specific kind.
Change-Id: I4862e56e0f5624f30aadda26efc9dea672ab1f57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
Reduce the alpha of the marker if a cursor is at the same position as
the marker.
Fixes: QTCREATORBUG-28645
Change-Id: I01b1825fd3f393dcc75cc58d64a31f22e50e2648
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Checking whether a position is inside the first line is also not for
free. Only check the line number of a cursor position if we expect the
editor to have multiple lines per block or in other words line wrapping is
enabled.
Change-Id: I0e3cb1fbd11c250677f7c11d1a5c780f60085ec2
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
QTextLines cursorToX indirectly calls shapeText which is not for free.
We just want to have the x position for the line so there is no need to
shape the complete text to get the position of the first cursor.
Change-Id: I0ae636ed8250385b7ac77c6f37d45922bbf2e9bf
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>