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>
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>
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>
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>
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>
The interface can be used for checking the context of a codeassist
request to determine
the correct processor that has to be created.
Change-Id: I47ddb05c46399566e27bae21711f11a3a4132c3f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Do not close already visible proposal widget if we get new results for
the same base position. Just replace the model of the widget and update
the prefix.
Change-Id: I298aba6eb8177edc17fea783189a2f987dbf15a2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... and make use of them with clangd.
This way, users can get immediate feedback when a new proposal entry
has been found, rather than having to wait until all of them have been
collected.
Change-Id: I2adfe0153aa7a058f28eb3bd65c71dd30ea018e0
Reviewed-by: David Schulz <david.schulz@qt.io>
.... when following virtual function calls.
This brings us up to par with the built-in code model.
We do lose the icons, but they are of very little use in this context.
Change-Id: I29b27d538e7277d06a5af7acee07bddb6eb94c98
Reviewed-by: David Schulz <david.schulz@qt.io>
Since the FunctionHintProposalWidget is just a proxy witget that uses a
FakeToolTip it is not shown directly so we cannot check the visibility
with isVisible.
Fixes: QTCREATORBUG-25664
Change-Id: I6888e373afcfc79565ce8e3dad1bb05501d58200
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Use QCoreApplication::instance() as a context object for the
IAssistProposal deleter.
Change-Id: Idf8cd1955dca146a500da1ea036298455c8a5da1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This makes sure that the old proposal widget is disconnected from the
finalizeProposal slot and thus prevents resetting the currently shown
proposal.
Change-Id: I80d58d9a04831d464bea69697568359990ac5260
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Cleanup the proposal after an item is activated even if the proposal
widget is not visible anymore. Otherwise we might wrongly cleanup a
proposal that was triggered by a completion character while a completion
list was already open.
Change-Id: Ie95247de09313c5816cffd9a865b05183db02354
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... while proposal is shown
amends 23d63dcc8b
Fixes: QTCREATORBUG-24225
Change-Id: Ie935c7c1d4786a4fd3cf338d7f1df52ae28de63b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
It's unclear why that was done, and it threw off the clang code model by
introducing an unexpected sequence of events.
Fixes: QTCREATORBUG-18676
Change-Id: I4dabb56eb97e18141080c22be324c826202977ce
Reviewed-by: David Schulz <david.schulz@qt.io>
Adapt to QStringRef and QAbstractItemView::viewOptions() removal
Task-number: QTCREATORBUG-24098
Change-Id: Ia2d446312f68bd60143796284d31f5bba56aa0ed
Reviewed-by: David Schulz <david.schulz@qt.io>
... and support it in the ClangCodeModel.
This allows users to get function signature(s) displayed regardless of
where exactly the cursor is on the function call.
Fixes: QTCREATORBUG-19394
Change-Id: I033e8774db93680bfc3ee52610b817e0ef8ccc76
Reviewed-by: David Schulz <david.schulz@qt.io>
Set a null proposal has the potential to restart the processor
in combination with the invalidateCurrentRequestData from this
cancelCurrentRequest will result in a restarted processor that is not
tracked via m_asyncProcessor.
Change-Id: Ia0e0d49564170a1e705994933d07e00c23f24f5d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Currently the ownership of the processor is unknown to the codeassist
when running an async operation. Move the ownership of the processor to
the assist and delete the processor after the proposal was completed.
Change-Id: I6a2e023c47cbc876669dba866bee12b481447cb7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Fixes crash when the processor reports a result after the code assistant
was destroyed.
Change-Id: I8588d3d6acad69f1ec6302e8ba09d642ebbb77f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.
Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Previously, accepting an item from the completion pop-up triggered
another completion request, but the result of that request was never
displayed since the inserted text was a perfect match.
Now, trigger another completion request only if the inserted text
matches the activation characters.
Change-Id: Ic8ed4139efb10aadc8d41105634fcc856e0a15be
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Since
commit d61d29cf16
Introduce a basic client for the language server protocol
extra proprosals were requested in the fragile case on a change
notification, e.g. for function signature completion. Restrict this to
the language client proposal, as it was actually intended.
The language client does not support prefixes, so introduce this concept
for deciding whether to request new proposals or not.
Done-with: David Schulz
Change-Id: Ibc1ad82dbeeea93b85f279c59b8c7289fe6ec726
Reviewed-by: David Schulz <david.schulz@qt.io>