aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python/pythonlanguageclient.cpp
Commit message (Collapse)AuthorAgeFilesLines
* LSP: mark some clients as not activatableDavid Schulz2025-05-061-1/+0
| | | | | | | | | | | | | | Differentiate between normal lsp clients that can be used for tasks like completions/outline/highlight and those that just uses the protocol to have a basic document update communication and uses their own messages for specialised tasks like the copilot, coco or ai assistant server. The user should not be able to manually switch to any of those servers as the active server for the current document, so filter those servers in the editor tool bar. Task-number: QTCREATORBUG-32909 Change-Id: Idd5e1c10e613ce986a56defad02a3787aeae85b2 Reviewed-by: Marcus Tillmanns <[email protected]>
* InfoBar: Unify code for hiding / suppressing info on button clickEike Ziller2025-04-291-16/+23
| | | | | | | | | | | | | | | | | | | | | | Many buttons that are added to info bar entries should also hide the info bar when clicked, and many should even suppress the info bar from showing again (persistently or for the session). The code for that is duplicate in all the button callbacks, which is error prone and also globally retrieves the info bar again on button click, which makes assumptions that we want to break in the future (ICore::infoBar() can return a different info bar, depending on settings, which can change during runtime). Add an additional enum parameter to InfoBarEntry::addCustomButton() that unifies that behavior at a central place, and also unify the button click handling for the InfoBarDisplay implementations. This actually fixes a bug with hiding the "Update" info bar which used an outdated and wrong ID for the duplicated hiding code. Change-Id: I20cd5b5b566e817a873daa6fb77db25eefcb32f0 Reviewed-by: Alessandro Portale <[email protected]>
* LanguageClient: have one LanguageClient per BuildConfighjk2025-04-291-16/+11
| | | | | | | | Language server behavior does not depend only on the project files but also on Kit configuration and in some cases the actual build. Change-Id: I1c26de62da9e5ee2f2f9e655f23cd2d30cfedd85 Reviewed-by: David Schulz <[email protected]>
* Fix some compiler warningsChristian Kandeler2025-04-171-1/+3
| | | | | Change-Id: Ibd2ab0fc9ceac9b59f64d4501188601e40fe6893 Reviewed-by: Christian Stenger <[email protected]>
* Replace most expected_str by Utils::Resulthjk2025-04-111-1/+1
| | | | | | | | Keep it in Axivion dto, which is generated. Change-Id: I83a12de6234ac7b0218b369875bdc72d25dbadfb Reviewed-by: Eike Ziller <[email protected]> Reviewed-by: Jarek Kobus <[email protected]>
* Avoid potential detach of non-const Qt containers in range-loops 2/2Alessandro Portale2025-03-241-1/+1
| | | | | | | By using std::as_const Change-Id: I8be5cbdbdd677bd9c6d849f701a7eef95b1c6792 Reviewed-by: Christian Stenger <[email protected]>
* Python: Fix check for outdated pylsDavid Schulz2025-02-101-33/+48
| | | | | | | | | | | | | | Unfortunately pip still reports the python language server as outdated even if the package was updated, most likely since the old package is still in that directory. So instead of purely relying on the pip output we compare the pip reported current version against the version the python language server reports when startet with "--version". Since neither the pip nor the version check is completely free we cache this information now in case the server is installed or it is not and no pip is available. Change-Id: I3a56fd5240672555bd54e92685c0c58c4dc95d7c Reviewed-by: Christian Stenger <[email protected]>
* Python: Fix assigning python documents to a pylsDavid Schulz2025-02-101-3/+1
| | | | | | | | | | | The entry for document check was introduced to avolid adding temporary documents to a python language server, but it seems it does not work reliable. Using the explicit Document::isTemporary is superior for this check. Fixes: QTCREATORBUG-32468 Change-Id: Ie6e920e975a3dcc0fe17eeae02e7d3b9610e08e6 Reviewed-by: Christian Stenger <[email protected]>
* Python: avoid accessing deleted extra compilerDavid Schulz2025-01-211-10/+20
| | | | | | | | | | | It looks like we delete extra compilers without properly unsetting them in the python language client. Connect to the destroyed signal of the extra compilers and ensure that the compiler is untracked in the client with an assert if it was not properly untracked before the destruction. Fixes: QTCREATORBUG-32362 Change-Id: I53dbf2877d74420424f5a590d4fc0eeb3df469ef Reviewed-by: Christian Stenger <[email protected]>
* ProjectExplorer: Add and make use of forwarding accessors in ProjectChristian Kandeler2025-01-201-7/+5
| | | | | | | | | Most accesses to activeTarget() are for getting to the active kit or build/deploy/run configuration. Simplify client code by adding convenience functions for that. No functional changes intended. Change-Id: Ide266712d19f960e4512672eb3bd00fc4d21b47b Reviewed-by: hjk <[email protected]>
* Utils: Rename FilePath::toString() into toUrlishString()hjk2025-01-101-1/+1
| | | | | | | | | | | | | | | | toString() is almost always the wrong conversion, but unfortunately too easy to find and often even working at least for local setup. This here raises the bar as the non-availability of the "obvious" toString() hopefully helps people to think about the semantics of the needed conversion and choose the right toXXX() function. The chosen new name is intentional ugly to reduce the likelihood that this (still almost always wrong) function is used out of convenience. Change-Id: I57f1618dd95ef2629d7d978688d130275e096c0f Reviewed-by: Eike Ziller <[email protected]>
* Utils: Add FilePath::isLocal() and use it instead of !needsDevice()hjk2024-12-091-2/+2
| | | | | | | | "needsDevice()" is an odd name, but keep it for now until downstream has caught up. Change-Id: I1fdb65d55e84e31512edb8f0bea8a0a3f7b2879c Reviewed-by: Marcus Tillmanns <[email protected]>
* Python: fix crash on shutdownDavid Schulz2024-11-151-1/+3
| | | | | | | | | Do not add a temporary document to a Language Client since it will not get properly removed when it is closed again. Fixes: QTCREATORBUG-32011 Change-Id: I66dfddec10610e54c1ae53e4a5e9db828ed03182 Reviewed-by: Christian Stenger <[email protected]>
* CommandLine: Use more 1-arg c'torJarek Kobus2024-05-161-1/+1
| | | | | Change-Id: If52c4094f94859d51e31862d913b1756e333e512 Reviewed-by: hjk <[email protected]>
* Python: offer to install python-lsp-server updatesDavid Schulz2024-05-031-23/+83
| | | | | Change-Id: I4068da0783b0a8e2becfcd04d480c6ad2e2f5b7c Reviewed-by: Christian Stenger <[email protected]>
* Utils: Fix build with MSVC with C++20Eike Ziller2024-02-281-1/+1
| | | | | | | | | | | | | | | | | Rename process.h back to qtcprocess.h MSVC's "threads" standard header includes <process.h>, and that ends up including our process.h from Utils. There already was a hacky workaround in place for a similar issue with MINGW, but that doesn't work with MSVC because that doesn't have Simply use a name that doesn't conflict. Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: <[email protected]> Reviewed-by: hjk <[email protected]>
* Various plugins: Fix some more C++20 warnings about [=] capturesJarek Kobus2024-02-061-7/+6
| | | | | | Change-Id: If20aac4320c84096a07d67cc137886638286acf8 Reviewed-by: hjk <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Utils: Fix error prone default value of appendOrSetMarcus Tillmanns2024-01-261-6/+2
| | | | | | | | | | | | | | | It was not readily clear that Environment::appendOrSet/prependOrSet needed a value for "sep", otherwise it would just concat the values without separator. This got apparent when looking at usages of appendOrSet. Instead there are now three options, "Auto", "Colon" or "Semicolon" with the default being "Auto", which determines the separator based on the Environment::OsType. Usages of appendOrSet and prependOrSet are also fixed with this commit. Change-Id: I868e14ce38f50be9cd07292fe3f22663a62d116d Reviewed-by: hjk <[email protected]>
* Use more std::chrono and std::chrono_literals namespacesJarek Kobus2024-01-231-1/+2
| | | | | Change-Id: Ib8c83988d7afe35d81b87ff8c5c87eef2082f12d Reviewed-by: hjk <[email protected]>
* Process: Get rid of setTimeoutS()Jarek Kobus2024-01-221-2/+1
| | | | | | | | Add an extra arg to runBlocking() function instead. Use std::chrono::seconds for timeout. Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e Reviewed-by: Orgad Shaneh <[email protected]>
* Python: Simplify PyLSConfigureAssistant setuphjk2024-01-161-23/+37
| | | | | Change-Id: Icdd8d0017a8fe71f579af6f19fa2b870f0677efc Reviewed-by: David Schulz <[email protected]>
* Python: Move plugin class definition to .cpphjk2024-01-161-1/+1
| | | | | | | | | The plugin classes partially changed there purpose, they are no more meant to provide internal utility functionality. Change-Id: I9b9200995eaa95dcd924c94dcedb28e6d5db0be9 Reviewed-by: <[email protected]> Reviewed-by: David Schulz <[email protected]>
* Python: install lsp into tempdir for remote interpretersDavid Schulz2024-01-081-14/+16
| | | | | Change-Id: I4b0b1a47c73742cc14f68d80b9116fcd51224bd1 Reviewed-by: Christian Stenger <[email protected]>
* Work on lambdas C++20 compatibilitySerg Kryvonos2023-12-131-1/+1
| | | | | Change-Id: I0d391c02ae1e1c5a1751b33ca7e83902e1cfe269 Reviewed-by: hjk <[email protected]>
* Python: Avoid polluting global or virtual environments with pylspDavid Schulz2023-12-131-49/+27
| | | | | | | | | | Install the language server into the Qt Creator resource directory instead. Reuse the server for all interpreters with the same version. This also reduces the amount of editor toolbars asking the user to install a language server for a specific interpreter. Change-Id: I48ef4ad30fe0097ee8d2b855b0f278e98be5ce57 Reviewed-by: Christian Stenger <[email protected]>
* Python: use kits page in python wizardsDavid Schulz2023-11-281-7/+17
| | | | | Change-Id: I1f7aaf145443481546abb868c8c167186600b848 Reviewed-by: Christian Stenger <[email protected]>
* Python: use correct python language server after installationDavid Schulz2023-10-301-11/+5
| | | | | Change-Id: Ie5e26eedffc51e8916d849121fa60ea3d56e5a66 Reviewed-by: Christian Stenger <[email protected]>
* Python: Fix debugger startArtem Sokolovskii2023-08-291-2/+5
| | | | | Change-Id: I9a26c591d174f5f079c4a673a6bf1aedd5cd709c Reviewed-by: David Schulz <[email protected]>
* Python: Centralize interpreter specific function in the aspecthjk2023-07-071-2/+3
| | | | | | | | | | ... and expose that instead of the PythonRunConfiguration. This makes the PythonRunConfiguration more the container of aspects, similar to where the other runconfigs move. Change-Id: Ibc76b706f2d4d334640ea8f3b91343f9e7c0f566 Reviewed-by: David Schulz <[email protected]>
* Python: reduce the timeout of version check commandsDavid Schulz2023-07-041-0/+1
| | | | | | Task-number: QTCREATORBUG-29363 Change-Id: Id7583c876dc2a8c92eae4dd68bda47dffafd6e3d Reviewed-by: Christian Stenger <[email protected]>
* Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}Jarek Kobus2023-05-041-1/+1
| | | | | | | | Follows QtcProcess -> Process rename. Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919 Reviewed-by: hjk <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Utils: Rename QtcProcess -> ProcessJarek Kobus2023-05-041-2/+2
| | | | | | | | Task-number: QTCREATORBUG-29102 Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: <[email protected]> Reviewed-by: hjk <[email protected]>
* Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}Jarek Kobus2023-05-031-1/+1
| | | | | | | Follows AsyncTask -> Async rename. Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225 Reviewed-by: hjk <[email protected]>
* Python: Allow installing multiple pip packages in one taskDavid Schulz2023-04-061-1/+1
| | | | | Change-Id: If6cc1373cd38c07b29ac48fa51bf0ed35d6f104b Reviewed-by: Christian Stenger <[email protected]>
* Python: Use QtConcurrent invocation for async runJarek Kobus2023-03-101-2/+2
| | | | | | | Change-Id: I26254d5c78c3b6ea06ed9baec8e52b988a6e9608 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: David Schulz <[email protected]> Reviewed-by: <[email protected]>
* ProjectExplorer: Move some not-fully-session related bitshjk2023-03-011-1/+1
| | | | | | | | | | | | | | | ... out of SessionManager. The idea is to later move SessionManager into the Core plugin, which both is sensible conceptually and also prerequisite to merge the Bookmark plugin into TextEditor plugin. Currently, only the interface is split, as the load/save implemetations are non-mechanical to disentangle. Change-Id: I31631db3094ea192825a2ccaa6add6188662940b Reviewed-by: Eike Ziller <[email protected]> Reviewed-by: <[email protected]>
* Python: remove outdated pyls install toolbar earlierDavid Schulz2023-01-201-1/+1
| | | | | Change-Id: I9ba67bffcff159523eb44b4f486c11fc37085fa8 Reviewed-by: Christian Stenger <[email protected]>
* ExtraCompiler: Expose TaskItem for compile taskJarek Kobus2023-01-111-1/+1
| | | | | | | | | | | | This is an intermediate state before employing one common TaskTree inside CppProjectUpdater. Use multiple one-task TaskTrees for now. Refactor ExtraCompiler so that there is only one pure virtual method to be implemented (taskItem()) instead of two (2 run() overloads). Use TaskTree inside ExtraCompiler for running the compilation process. Change-Id: I6884934508e043594589d117f6d3f0aed94b84c2 Reviewed-by: Christian Kandeler <[email protected]>
* 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 <[email protected]>
* LSP: Support remote LSP file pathsDavid Schulz2022-12-151-1/+1
| | | | | Change-Id: If3cf1b8d675ef091427dbcd703c7d14b384a1b3a Reviewed-by: Christian Kandeler <[email protected]>
* Remove unused variablesJarek Kobus2022-12-091-1/+0
| | | | | | Change-Id: I653f6fa71bb04e049d4e1848a7e38a606692e678 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: hjk <[email protected]>
* Don't call non-const methods on temporary QListJarek Kobus2022-12-081-1/+1
| | | | | | | | Otherwise it may unnecessarily detach. Either store a local const reference or call const equivalent (e.g. constFirst()). Change-Id: I96d665487cf28c17e72bea17f1b8f164ce06cc70 Reviewed-by: Eike Ziller <[email protected]>
* Remove unused includes of QGridLayoutJarek Kobus2022-11-181-1/+0
| | | | | | | Change-Id: Ia0823fe1dbadb7c68efc431c3bf0f1ba621a9484 Reviewed-by: <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: hjk <[email protected]>
* Python: use consistent pyls naming in settingsDavid Schulz2022-09-051-1/+1
| | | | | Change-Id: I8a36e4089812802c3629ac52ce52499dde53eba8 Reviewed-by: Christian Stenger <[email protected]>
* 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 <[email protected]>
* Python: Convert to Tr::trhjk2022-07-211-8/+11
| | | | | | Change-Id: I0241053b0d51dbb1a60c43351cbff543fd52573d Reviewed-by: Eike Ziller <[email protected]> Reviewed-by: <[email protected]>
* Python: prevent setting local env to remote pylsDavid Schulz2022-06-271-6/+14
| | | | | Change-Id: Id0eea5420c897687e6931bf640e3a37ba2638b8f Reviewed-by: Christian Stenger <[email protected]>
* Python: remove static cast of client interface in client constructorDavid Schulz2022-06-201-2/+2
| | | | | Change-Id: I475a2b79438b8392085f1d9bf2cdb8b7369efa68 Reviewed-by: Christian Stenger <[email protected]>
* Python: remove python specific language client settingsDavid Schulz2022-06-101-261/+47
| | | | | Change-Id: Ic993d525f29c1925f7e64dfc6f5e053234fb4904 Reviewed-by: Christian Stenger <[email protected]>
* Python: globalize Python language server settingsDavid Schulz2022-06-101-203/+15
| | | | | Change-Id: I84fcee6462064f0c788492fcfa12a77379af2bd7 Reviewed-by: Christian Stenger <[email protected]>