When the completion request is triggered by an activation character,
set the triggerCharacter accordingly.
This can help the language server to propose more sensible items.
Detected while trying cmake language server. It was throwing an error
when triggerKind is TriggerCharacter and triggerCharacter is not present.
Change-Id: Ifde578e39f2eebfc5c6551f08985f4408f6c7933
Reviewed-by: David Schulz <david.schulz@qt.io>
Pass the real proposals around instead of a copied
nullptr.
Change-Id: I1a8678bcbd5838113f6416b6f63d92d6cceceb3f
Reviewed-by: David Schulz <david.schulz@qt.io>
We have to report back to the code assistant even if we have no results.
Otherwise the processors aren't correctly reset and may be called after
deletion.
Change-Id: Id7af2e0ee9f631efc00beb2a84bfe1824e138d24
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>
Instead of just unsetting the function assist provider and quick fix
assist provider reset it to the previous provider.
Change-Id: I46c5c2f14234e3da08480dd103e4634859447d57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.
Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
replacing the text from word start to current cursor position only works
if we are not currently at a word start. For example completing:
object.function(var|)
will not replace the already typed var, because selecting from cursor
position to word start does not select anything.
Try selecting from current position backwards as long as the inserted
text matches case insensitive to the already available text, or select
the match of the "[a-zA-Z_][a-zA-Z0-9_]" regex. Whichever selected text
is longer will be replaced.
Change-Id: I73965183ba430a8de1b7725e1f7bc7621861433f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
...instead of a null icon.
Without this, a completion item gets no icon and looks misaligned
between items with icons. For example, for the completion item "size_t"
(a typedef) clangd reports a completion kind of "Reference", for which
we do not have a dedicated icon.
Change-Id: Ibba658d6bfb958bb34747e3f57514af49f5427b0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
While a completion is currently active a commit character can
automatically apply the current item and close the current completion
widget.
Change-Id: Ia962eed69684f8f13f54b88934c63700532103e7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Instead of trying some magic when applying completion items just replace
the text from the current position back to the start of the word.
Change-Id: I03ac0f8c9bced88d21bd51f9e5cfa0a3ea25025a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>