aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/languageclient/languageclientcompletionassist.cpp
Commit message (Collapse)AuthorAgeFilesLines
* LSP: Compress document change notificationsDavid Schulz2020-06-221-2/+24
| | | | | Change-Id: Iaf6cb99784f4e1ed1291ace1f4cc18cf6af88672 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* LanguageClient: Replace QRegexp by QRegularExpressionChristian Stenger2020-06-191-3/+3
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: Ic8259ded3f721957bd04aa00146b20bd90b41dcd Reviewed-by: hjk <hjk@qt.io>
* LSP: fix codeassists running checkDavid Schulz2020-05-141-5/+5
| | | | | | | | Since MessageId is always valid (needs to be fixed separately) use an optional to store whether we have a request running. Change-Id: I7a1f136a09d776b33509bc914247d11076abeaa5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CodeAssist: Fix leaking asynchronous processorsDavid Schulz2020-05-121-0/+4
| | | | | | | | | 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>
* LSP: CompletionRequest: set triggerCharacter when possibleAlexis Murzeau2020-05-111-3/+8
| | | | | | | | | | | | 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>
* LanguageClient: Fix passing proposalsChristian Stenger2020-03-021-9/+8
| | | | | | | | Pass the real proposals around instead of a copied nullptr. Change-Id: I1a8678bcbd5838113f6416b6f63d92d6cceceb3f Reviewed-by: David Schulz <david.schulz@qt.io>
* Editor: Fix crash in codeassistDavid Schulz2020-02-261-2/+5
| | | | | | | | | 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>
* CodeAssistant: add cancel to asynchronous processorsDavid Schulz2020-02-201-4/+13
| | | | | | | | 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>
* LanguageClient: Fix some bugprone-branch-cloneNikolai Kosjar2019-11-041-1/+1
| | | | | Change-Id: If1eb43168db65190983049f30bf217f0628e78e4 Reviewed-by: David Schulz <david.schulz@qt.io>
* LanguageClient: more FileName to FilePath renamingDavid Schulz2019-09-171-1/+1
| | | | | | Change-Id: I803211d462b442b6881a02e870d2cd816675e0d9 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* LanguageClient: reset all assist providersDavid Schulz2019-09-111-1/+2
| | | | | | | | 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>
* Utils: Rename FileName to FilePathhjk2019-05-281-1/+1
| | | | | | | | 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>
* LSP: reredo completion replacement logicDavid Schulz2019-05-091-4/+17
| | | | | | | | | | | | | | | | | | 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>
* LanguageClient: Use empty icon for unknown completion item kindNikolai Kosjar2019-05-081-2/+1
| | | | | | | | | | | | | ...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>
* LanguageClient: enable commit characters for completion itemsDavid Schulz2019-05-071-2/+11
| | | | | | | | | 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>
* LanguageClient: redo completion replacement logicDavid Schulz2019-05-061-10/+5
| | | | | | | | 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>
* LSP: add completion context to completion requestDavid Schulz2019-04-251-0/+1
| | | | | Change-Id: I97df6d70ef2ad6e6e1fc0153cd1589b5d5c9683b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* LSP: collect and execute quick fixes via shortcutDavid Schulz2019-02-121-0/+405
Fixes: QTCREATORBUG-21802 Change-Id: I611fac1c3fc5b094816441e36492ed57706c98b8 Reviewed-by: Eike Ziller <eike.ziller@qt.io>