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>
Only take text marks with icons into account when looking for the three
textmarks with the highest priority to be drawn next to the line number.
Fixes: QTCREATORBUG-25427
Change-Id: I9c0b9cac2e34134e59071a4e2357585b3071c303
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
Split out the snippet functionality into a new derived
overlay implementation.
Change-Id: I2d7fffabe16ce6348ed067eb52ff221420a23285
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Qt Creator required Qt 5.14 or higher. Let's removed the #idef-ed code
for building against lower Qt versions.
Add a comment in porting.h where we still need such code for sdktool.
Change-Id: Ib330275208eec4a2f285b4b9f480530c171f538a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This updates the tab settings to the correct one for the specific
language like C++ or QML. Only observable if the file is not part of a
project. Otherwise the project code style settings will set the language
specific tab settings.
Fixes: QTCREATORBUG-25485
Change-Id: I736646557a213369903fe495e3b5a3a950141961
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Use QCoreApplication::instance() as a context object for the
IAssistProposal deleter.
Change-Id: Idf8cd1955dca146a500da1ea036298455c8a5da1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>