Commit Graph

7 Commits

Author SHA1 Message Date
hjk
473a741c9f Utils: Rename FileName to FilePath
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>
2019-05-28 12:23:26 +00:00
David Schulz
970a09519d LSP: reredo completion replacement logic
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>
2019-05-09 10:25:24 +00:00
Nikolai Kosjar
741e8d8aba LanguageClient: Use empty icon for unknown completion item kind
...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>
2019-05-08 06:17:16 +00:00
David Schulz
d28a452053 LanguageClient: enable commit characters for completion items
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>
2019-05-07 07:57:41 +00:00
David Schulz
5eca6c031f LanguageClient: redo completion replacement logic
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>
2019-05-06 09:01:15 +00:00
David Schulz
0eb3b54434 LSP: add completion context to completion request
Change-Id: I97df6d70ef2ad6e6e1fc0153cd1589b5d5c9683b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-25 06:24:05 +00:00
David Schulz
c6415e2652 LSP: collect and execute quick fixes via shortcut
Fixes: QTCREATORBUG-21802
Change-Id: I611fac1c3fc5b094816441e36492ed57706c98b8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-12 12:57:31 +00:00