aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/languageclient/languageclientfunctionhint.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use QString::size() instead QString::length()hjk2025-11-131-3/+3
| | | | | | | Minor gain in debug builds and when stepping. Change-Id: I2540d309661e4babfd7331b068c17657ded2a098 Reviewed-by: David Schulz <david.schulz@qt.io>
* Use QStringList instead of QList<QString>Alessandro Portale2025-10-021-4/+4
| | | | | Change-Id: I56fabbfe32ab579ef5e9f7c8cc5fde220b99769a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* LanguageClient: improve clangd function hintDavid Schulz2024-03-111-24/+13
| | | | | | | | | | | | Add a Clangd specific function hint model that alwys highlights the current parameter based on the number of commas in front of the cursor position, like the builtin code model. It also correctly closes the proposal after typing the closing parenthesis. Fixes: QTCREATORBUG-26346 Fixes: QTCREATORBUG-30489 Change-Id: I09d3ac6856acfe5e0f206d8c3a96dbb561ea2ce7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | 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>
* LSP: Support remote LSP file pathsDavid Schulz2022-12-151-1/+1
| | | | | Change-Id: If3cf1b8d675ef091427dbcd703c7d14b384a1b3a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Editor: move ownership of assist interface to processorDavid Schulz2022-11-171-6/+5
| | | | | | | | | | 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>
* Editor: unify assist processor handlingDavid Schulz2022-11-141-6/+1
| | | | | | | | | | | 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>
* Editor: delete assist interface in lsp/clangd supportDavid Schulz2022-11-081-0/+3
| | | | | | | | | | | | 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>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | 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>
* Utils: Remove Utils::optionalEike Ziller2022-09-011-1/+1
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/7.0' into 8.0Eike Ziller2022-06-021-0/+2
|\ | | | | | | | | | | | | Conflicts: src/libs/utils/launchersocket.cpp Change-Id: I7ec649485bb7fc7c299b571d92519d2b7fc9506b
| * LanguageClient: Avoid crashes when language client is invalidAaron Barany2022-05-311-0/+2
| | | | | | | | | | | | | | | | | | | | This can occur in situations such as clangd crashing. A similar guard is used in the perform() function, but can still crash in cancel() or handleSignatureResponse() if the client is destroyed beforehand. Fixes: QTCREATORBUG-27096 Change-Id: Ib33d306c5411bc31bc13de399e6c2ad0a89462f4 Reviewed-by: David Schulz <david.schulz@qt.io>
* | LanguageServerProtocol: remove IContentDavid Schulz2022-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | Do not pretend to support multiple message types, while no other messages are actually implemented by us or even known to exist in the wild. Change-Id: I49ee2118b2e10f265ac641c195df8a9e5c97951c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Merge remote-tracking branch 'origin/7.0'Eike Ziller2022-05-091-0/+1
|\| | | | | | | | | | | | | | | Conflicts: src/libs/utils/qtcprocess.cpp src/plugins/cppeditor/cppcodemodelsettingspage.cpp Change-Id: I602f4ff13f9370ec20704efaea34b42445a75fd4
| * LanguageClient: track running function hint processorDavid Schulz2022-05-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | A tracked assist processor gets indirectly deleted in the client destructor and the reset function. This makes sure no processor accesses a deleted or restarted client. Fixes: QTCREATORBUG-27404 Change-Id: Ib264eb4b166f1705bd734299642b93bca0a402c3 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | LanguageClient: avoid optional::valueDavid Schulz2022-02-241-2/+2
|/ | | | | | | | | Potentially throws std::bad_optional_access. Use operator* and operator-> instead. Change-Id: Idefa137da53f3663ea88961f1105b93402ec4777 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* LSP: Add support for activeParameter of SignatureInformationDavid Schulz2021-09-301-4/+5
| | | | | | Task-number: QTCREATORBUG-26346 Change-Id: Ieab18f08e4f1b9fa6cacfae0a18310af4bc35165 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* LanguageClient: remove codeassist proposal handlerDavid Schulz2021-09-281-14/+5
| | | | | | | | | Removes noise from the interface. Using specialized clangd processors that redirect the proposals for testing purposes is an overall cleaner solution. Change-Id: Ia4f3d4720765f0533c5530a2a5c7db3cc971e0be Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* LanguageClient: export FunctionHint code assistDavid Schulz2021-09-171-19/+4
| | | | | Change-Id: I57a819b11bb2eb44662c98862643146a686a8c06 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Editor: pass AssistInterface to createProcessorDavid Schulz2021-09-161-1/+2
| | | | | | | | | 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>
* ClangCodeModel: Use clangd for completion and function hintChristian Kandeler2021-08-231-5/+16
| | | | | Change-Id: I80160f3a40da18ac178682afe6caba5e5af6e3eb Reviewed-by: David Schulz <david.schulz@qt.io>
* LanguageClient: highlight current argument in function hintDavid Schulz2021-07-121-1/+20
| | | | | Change-Id: I23be02c4bef30a527ba9f419a059c1d3bfed1c2b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* LanguageClient: Fix function hint range checkDavid Schulz2021-06-211-1/+1
| | | | | Change-Id: I82d25ef6f2c12ea3af70ba973e940bcea08a79b8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* LanguageClient: Fix possible nullptr accessChristian Stenger2021-04-221-1/+6
| | | | | | Fixes: QTCREATORBUG-25528 Change-Id: I23d50b8bb0a3112eab3eac6a9300e2783b8bb939 Reviewed-by: David Schulz <david.schulz@qt.io>
* LanguageClient: Fix dynamic registered signature helpDavid Schulz2021-01-261-3/+4
| | | | | Change-Id: Ie7427f4a0aede5c933995610d03791e837ad39e4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: use Utils::FilePath as file member in AssistInterfaceDavid Schulz2020-09-041-1/+1
| | | | | Change-Id: I3bf9b013b9350411f918efdb9d1a36a2c22bf972 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* LSP: Explicify APIDavid Schulz2020-07-151-2/+1
| | | | | Change-Id: Id208a420fd3e1e23d3279c4f1f19bdbed994a8d3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* LSP: fix codeassists running checkDavid Schulz2020-05-141-6/+8
| | | | | | | | 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>
* LSP: do not create empty function hint proposal modelDavid Schulz2020-05-141-3/+7
| | | | | | | | Fixes: SOFT ASSERT: "d->m_totalHints != 0" in functionhintproposalwidget.cpp Change-Id: Ibfda27bf1e02b60d624851995ce1f5f54f662182 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CodeAssist: Fix leaking asynchronous processorsDavid Schulz2020-05-121-0/+2
| | | | | | | | | 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>
* 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: 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>
* LanguageClient: add signature help providerDavid Schulz2019-05-211-0/+144
Change-Id: Ia89c28b574c92802bbfda280115a50f5955f0854 Reviewed-by: Christian Stenger <christian.stenger@qt.io>