- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
wrappers, that also includes the "public" headers for MimeType et al
from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
back to utils/mimetypes/mimedatabase.h
Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The default implementation configures the generic highlighter based on
the documents file name and content. Add a way to force the highlighter
to use a highlight definition for a specific mime type.
Change-Id: I1c6fca1be9bcb5c4276b5aa2dbb724680fe98ddc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This reverts commit 5a3648c895.
Reason for revert: breaks other shortcuts like shift+del to cut the current line under the cursor
Change-Id: I5313c66df9dfa4283cc3f84ce9e7fd5464d0f73e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Do not eat all ShortcutOverride events. Let the rest of the class &
widget hierarchy know about them too.
Fixes: QTCREATORBUG-26764
Change-Id: I7e2f42183bc9cb3931aca3669a6703c83e39b4bc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Only select the lines if the cursor has no selection. If we have
multiple cursors with a selection the user most probably want to copy or
remove this selection.
Fixes: QTCREATORBUG-26761
Change-Id: Idbf36a878e3d56ea34542b5de390c547bd8bcd6b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Prevent scrolling to the end of the document after triggering select
all.
Fixes: QTCREATORBUG-26736
Change-Id: I744dddee87ac16ae2399d37483552fc6b535df46
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Do not include lines into the block selection that are shorter than the
block selection start column.
Task-number: QTCREATORBUG-26548
Change-Id: I6e4e26e1c498fb02dd0ebc8b78b8907c23f356b8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The location of the blocks to marked ifdefed out are not tied to a
specific editor instance, but just depend on the document content.
Change-Id: I837730dc00e1d6060dd46bbb2cfccbfa5f72e6ce
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Otherwise some internal data might be outdated. For example inserting
text resets the QTextCursorPrivate::x which is used to calculate
positions when moving the cursor up or down.
Fixes: QTCREATORBUG-26635
Change-Id: I9fee7436a3648f9d3eab7b30f8a09a134c5be356
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If we remove a hover handler from the editor we have to reset the last
cached hover result in the runner to prevent using this removed and
potentially deleted hover handler.
Change-Id: I2bbdbee9d018aac426832552d036926be9ff198e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
These block selections are a convenience for people used to the block
selection allowing to also unselect parts again (at least as long as
alt+shift is pressed).
Fixes: QTCREATORBUG-26535
Fixes: QTCREATORBUG-26529
Change-Id: I19558dc1d823c268cc1cfda0ea8151bac483701f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Update the main cursor after calling QPlainTextEdit::mouseReleaseEvent.
Calling that function might change the selection without changing the
position, so it wont emit cursor position changed, and the multi cursor
does not get updated properly.
Task-number: QTCREATORBUG-26493
Change-Id: Ie310ee9a4c66897766af87065ee42fcd01302854
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Adding a way to create multiple cursors that can insert/remove text at
arbitrary positions in the document. Adding cursors is done by pressing
alt + up/down or by clicking into the editor while holding the alt key.
Fixes: QTCREATORBUG-16013
Change-Id: I495d27d95a3d277220946616ef30efc241da0120
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
... after updating the parenthesis in the layout
Task-number: QTCREATORBUG-26183
Change-Id: I346046fbc3932b94227c1ac5bee6b0d7c44651e1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... for the context of the code assist instead of using a callback from
the text editor.
Change-Id: I636b1b267a944895d4ff732e3c0a8811332ec14f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
That is, don't just ask one random hover handler, but try all of them
and use the best one.
Change-Id: I38d0a90e96090c56240314a90f0f428c88fd222c
Reviewed-by: David Schulz <david.schulz@qt.io>
After the TextEditorWidgetPrivate's d'tor has finished,
compiler starts destructing all the member fields of
TextEditorWidgetPrivate before calling base QObject d'tor.
Some d'tors of some members may still emit signals which
are connected to TextEditorWidgetPrivate's slots. In this
case we may start operating on corrupted internals.
Fixes: QTCREATORBUG-26001
Change-Id: I865cad16601b278fe7f7cf95145557310bb83126
Reviewed-by: David Schulz <david.schulz@qt.io>
Note that we temporarily lose the ability to hover over an include and
get the full path of the header file. This is a valuable feature that we
need to restore, preferably by fixing clangd itself.
Fixing the remaining few test failures would likely require more
complicated code as well as additional LSP round-trips, and as of now
I'm not convinced it is worth the effort.
Change-Id: I08c72c4bd1268bbd67baeb57bbfd29d9b11303a5
Reviewed-by: David Schulz <david.schulz@qt.io>
The KSyntaxHighlighter Definitions provide single and multiline comment
markers. So check against those when trying to automatically fold the
first license header instead of assuming that '#' and "/*" are comment
markers.
Task-number: QTCREATORBUG-25882
Change-Id: I3a84cfc45445caad3b40feb996cfb781a5fb3190
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... 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>
... so we can re-use the "follow symbol" test cases with clangd.
Call Creator like this (clangd needs to be version 12 or later):
$ QTC_CLANGD=<path to clangd> qtcreator -test
'CppEditor,*Follow*,*Switch*' -test 'ClangCodeModel,*dummy*'
During testing, some invalid code in the test cases was uncovered and
fixed.
Change-Id: I9dc650fdba2a27600e6a550420ee873f6fb31d23
Reviewed-by: David Schulz <david.schulz@qt.io>