Calling displayProposal might spawn another eventloop that potentially
deletes the processor before the async proposal handler finished.
Fixes: QTCREATORBUG-28989
Change-Id: I3a8ddb9180cb7737a37ea39dc59d922e83615ed6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
It is required for updating currently visible proposals. Also guard
against potential null assist interfaces.
Amends 0bd6d7a69f
Fixes: QTCREATORBUG-29096
Change-Id: Ic34d70561b471e7e529f2fb7c239b49712aca502
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
If the use erxplicitly requested the completion hide the suggestion
otherwise ignore the completion.
Change-Id: I52485e322b0521b0af10ae6945437bf96642ad89
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>
BTW, spotted some other unused includes marked with yellow.
Change-Id: I364e4b6fae73a2be2cfd3a63c1100be4a91aa49a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Prevent updating the model with something other than a generic proposal
model.
Change-Id: I3880c1ce4ae7cf0aa4fb72d59b75a40db3f53482
Reviewed-by: hjk <hjk@qt.io>
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>
...from the code assistant to the language client specific assist
implementation. This further reduces the complexity of the code
assistant.
Change-Id: I08ba5eecea826d3ccfe7f1f5a8791a085299d6ef
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
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>
A code assistant is not usable without a text editor widget and is
always created as part of one, so make the dependency obvious by require
it in the construction of the code assistant. This removes a bunch of
functions and cheks.
Change-Id: I96556430082ff729d99d2ae2516599f9b8cbc704
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
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>
... at the current position. This reduces the amount of requested
completions.
Change-Id: I0fa35269bc123513217e3b3abd2c921bd92d8d10
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The complete memory management in the code assistant needs an overhaul.
For now just delete or at least track the assist interface with scoped
pointers.
Fixes: QTCREATORBUG-28408
Change-Id: I0bd4cfaa36a660b6fd5bb467af3b13414ed76e63
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
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>
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>
Those proposals are not fragile anymore since they reuse the old
completion widget. This fixes vanishing of none idle editor completions
on backspace if there are less than 3 characters to complete.
Additionally this removes the double completion request if there are
more than 3 characters typed in.
Change-Id: Id47d341adf954dfaaaeb70c17f6774ba38cc8bdf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This reverts commit 7d4d57165c.
The change signal should be send from the editor widget, so no need to
call it again from the function hint widget, since it also cancels the
automatic proposal timeout that triggers the automatic completion
request.
Fixes: QTCREATORBUG-27305
Fixes: QTCREATORBUG-26959
Change-Id: I37810e0a6083396bd0375b4ae28aa07389a5079c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
To prevent closing function hint widgets after the completion processor
did not return a proposal.
Change-Id: I1901f3f21917d348ef12a6db846739e3c54752fb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Set the correct assist reason when rerequesting a code assist to be able
to detect perfect matches. Also destroy the code assist context when the
processor is not running and has not returned a proposal after perform.
Change-Id: Ieb04203269076655ac3d7ffc54ea8a1d055194a4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This will allow us to request assistance for a specific selection
instead of just the position.
Change-Id: Ib8e5b32d4a8f2936e5a6f1b7ac968d7f1d8d9de6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
If a new processor is started while waiting for a result of a still
running procesor reset the flag whether content was received while
waiting.
Change-Id: I21a254681050d1db077deec88706f0010670e0ac
Reviewed-by: Christian Kandeler <christian.kandeler@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>