aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/python/pythoneditor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid including multiple Tr classesEike Ziller2025-09-261-2/+1
| | | | | | | | | | | | | | | | | | | | lupdate has issues finding the right translation context if there are both Tr::tr calls that should be resolved via a `namespace <name> {` scope, and another `using namespace <other>` with a namespace that has another Tr class. Many of the cases of this that we have were editor display names that were defined in the Core plugin for reasons unknown, and which would better be defined in the corresponding plugin anyway. For the other cases do not use Tr::tr from a different plugin, but instead introduce "msg<Something>" functions that do the Tr call plugin- internally. That is the "correct" way to do it anyway, since shared strings should be changeable centrally. Task-number: QTBUG-140548 Change-Id: Idacf62b400f50789b5e5957b690e16aa1ebe5a56 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Introduce Project::setActiveBuildConfiguration()Christian Kandeler2025-03-121-12/+5
| | | | | | | ... and make use of it in Python plugin. Change-Id: I1a50c4e92ba33c1dd05aa9474ac80ec9f4f2c2cf Reviewed-by: hjk <hjk@qt.io>
* Add pyproject.toml support for Python projectsJaime Resano2025-03-111-6/+6
| | | | | | | | | | | This patch adds support for the standard Python project configuration file: pyproject.toml. It is intended to replace *.pyproject files. Task-number: QTCREATORBUG-22492 Task-number: PYSIDE-2714 Change-Id: I783ee7b49be23c61b0a501ef9bbd722cc652ad14 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Jaime Resano <Jaime.RESANO-AISA@qt.io>
* Python: Fix assigning python documents to a pylsDavid Schulz2025-02-101-1/+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 <christian.stenger@qt.io>
* ProjectExplorer: Add and make use of forwarding accessors in ProjectChristian Kandeler2025-01-201-2/+1
| | | | | | | | | 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 <hjk@qt.io>
* Python: fix crash on shutdownDavid Schulz2024-11-151-1/+2
| | | | | | | | | 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 <christian.stenger@qt.io>
* Python: offer to install pyside also in qml filesDavid Schulz2024-04-221-1/+1
| | | | | | | | | | This shwos the same editor toolbar as in the python editor that offers to install pyside, if the qml file can be associated to a python project and the configured python for that project does not contain a valid pyside. Change-Id: Id05a2621aec9d78c4a22e61830813cd261eda4fc Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: remove text editor action handlerDavid Schulz2024-04-091-5/+4
| | | | | | | | | | Give each editor a context and register editor actions individually for that context. This removes the need to tell the action handler the current editor. Additionally all actions are now available in editor widgets outside of the EditorManager. Change-Id: I0109866b180889762f8bd8aa07874d8d7c55bfa6 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Remove CommandButtonEike Ziller2024-01-261-1/+0
| | | | | | | | | The same can be achieve with a factory method in `Command`, similar to the existing ones for actions and buttons which synchronize their tool tips with the shortcut. Change-Id: I7e17654706b902dfa14f37b958fc2a60705d5cb5 Reviewed-by: hjk <hjk@qt.io>
* Python: Simplify PyLSConfigureAssistant setuphjk2024-01-161-2/+2
| | | | | Change-Id: Icdd8d0017a8fe71f579af6f19fa2b870f0677efc Reviewed-by: David Schulz <david.schulz@qt.io>
* Python: Use new plugin items setup pattern for PythonEditorhjk2024-01-161-23/+32
| | | | | Change-Id: Ie8516960a106ddeff415b6412d9af66f7d2f0f36 Reviewed-by: David Schulz <david.schulz@qt.io>
* Python: Move highlighter and indenter class definitions to .cpphjk2024-01-121-2/+2
| | | | | | Change-Id: Ib71d520977034ca66bd84c9188ffed5fe74e1ba0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Python: use kits page in python wizardsDavid Schulz2023-11-281-124/+165
| | | | | Change-Id: I1f7aaf145443481546abb868c8c167186600b848 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core: De-QObject-ify editor factorieshjk2023-08-181-1/+1
| | | | | Change-Id: Iaf39ad29576638e994dd2f28d323e445ce2ee93f Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Centralize style-related property names as constantsAlessandro Portale2023-05-101-2/+4
| | | | | | | | | | This introduces string constants in Utils::StyleHelper. They are used by code all over in Qt Creator to tell ManhattanStyle how to paint certain widgets. Change-Id: Iecca36103f80084cd5fe93fcb6b18b8fbb3a32bb Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Python: add create venv option to the wizardDavid Schulz2023-03-271-5/+5
| | | | | | | | | and optimize layouting Fixes: PYSIDE-2152 Change-Id: If3ecb76c4bac885840f54fd382471ac22a06dee3 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Python: add create venv actionDavid Schulz2023-03-211-9/+28
| | | | | | | | | The action can be triggered from the interpreter chooser of the editor toolbar. Change-Id: Ie23b68a3790525ea02883ef359b357a0d317b2f5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ProjectExplorer: Move some not-fully-session related bitshjk2023-03-011-3/+3
| | | | | | | | | | | | | | | ... 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 <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Translations: Merge "OpenWith::Editors" into "QtC::Core"Alessandro Portale2023-02-201-2/+2
| | | | | | Change-Id: I241ccc53afa11fa3faa1f1ca9363421827081812 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Python: add interpreter selector to editor toolbarDavid Schulz2023-01-201-27/+163
| | | | | | Fixes: PYSIDE-2154 Change-Id: If5e90f5bf2923b61af37ebbfcd35c512b3b07db4 Reviewed-by: Christian Stenger <christian.stenger@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>
* 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/8.0'Eike Ziller2022-08-191-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts/comments out parts of 45f93a817a527e6dc81a8971dd2868b3da66cd84, which needs to be resolved in a follow-up commit. Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp src/plugins/clangcodemodel/clangmodelmanagersupport.cpp src/plugins/cmakeprojectmanager/cmakesettingspage.cpp src/plugins/python/pythoneditor.cpp src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp src/plugins/scxmleditor/common/colorsettings.cpp Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
| * Python: Fix detecting python ls for reopened filesDavid Schulz2022-08-081-4/+4
| | | | | | | | | | Change-Id: Icc601fa43c7b1432d0bf12fae2f65e0c914262ac Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Python: Convert to Tr::trhjk2022-07-211-23/+19
|/ | | | | | Change-Id: I0241053b0d51dbb1a60c43351cbff543fd52573d Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Python: remove python specific language client settingsDavid Schulz2022-06-101-1/+13
| | | | | Change-Id: Ic993d525f29c1925f7e64dfc6f5e053234fb4904 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: Apply 'static' pattern for singleton membershjk2022-04-271-2/+2
| | | | | | | | Plus some cosmetics. Change-Id: Ia2c8f425f0491fbe6a0bbf2e508857a5550e4d38 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
* Python: add PySide installation check on document openDavid Schulz2022-03-281-0/+2
| | | | | | | | | | Checks if the document imports PySide and whether the selected python interpreter can find a PySide installation. If not show a global info bar that can install PySide via pip like the python lsp server. Task-number: PYSIDE-1742 Change-Id: I02c0d5f6eb268f3d8826d4fb9d9ec3c7c48b8638 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: Use specialized document to check for pylspDavid Schulz2022-03-281-1/+20
| | | | | Change-Id: I9ea13df7fc04a4fe35d901da179b9c0ebaf57bb6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* PythonEditor: Fix a leak of console process on shutdownJarek Kobus2022-01-201-2/+2
| | | | | | | | | | | | | | | Give a parent for console process in order to delete it on shutdown. In case the console process was started and the user closed the Creator we were leaking console process instance together with its process. Connect to ConsoleProcess::finished() instead of stubStopped(). There is no point to keep the console open when the process finished (it forces the user to manually close the stub window by pressing enter). Change-Id: I3f14e940f39b32e11bde276e80f3cb630b13d8f7 Reviewed-by: hjk <hjk@qt.io>
* Add tool tip to REPL button in python editorEike Ziller2021-01-111-0/+4
| | | | | | | | The individual tooltips on the menu items might not be shown (possibly depending on platform). Change-Id: I0adb3f938de23dad4b70fa1f73a0b6a277b0386c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Python editor: Add buttons & actions for opening REPLEike Ziller2020-03-191-0/+66
| | | | | | | | Opens interactive Python, optionally with the current file imported, for testing and experimentation. Change-Id: Ieb120e3698bdba77a1445c40fe7fda533773a0cf Reviewed-by: David Schulz <david.schulz@qt.io>
* Python: Move PyLSConfigureAssistant connection to the pluginhjk2020-02-121-3/+0
| | | | | Change-Id: I2d3aecd10d8da7e7272ebca61c0fbeacbc257bd5 Reviewed-by: David Schulz <david.schulz@qt.io>
* Python: close all info bars after language server setupDavid Schulz2019-10-251-14/+1
| | | | | Change-Id: I607f7cb5a31f3db0c7d7d77011860a1ea87eb8d2 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: Switch pyls on interpreter changeDavid Schulz2019-10-181-311/+4
| | | | | Change-Id: I458b635986a55003a1e7254e27e2df9667704273 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: remove unused static stringDavid Schulz2019-10-021-1/+0
| | | | | Change-Id: I4357157d98f039c654b16de4e469c18c32bbb0ed Reviewed-by: hjk <hjk@qt.io>
* Python: add task for pyls installationDavid Schulz2019-09-301-9/+26
| | | | | Change-Id: I0a85a3ae9fe4e8b327b3b90732556bf940215b7a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: make pyls install kill timer a memberDavid Schulz2019-09-301-4/+3
| | | | | Change-Id: I62515673ef65e87b2f23345aa52a22a86a2be763 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: Add info bar to install python language serverDavid Schulz2019-09-301-3/+104
| | | | | | | | | If the detected python for the current document does not have an installed language server, check whether pip is installed, try to install the language server and if that was successful set it up. Change-Id: Ib6cf3bacdcf3489728990cace5417862b7c78be5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Python: Check for Python language server after document was openedDavid Schulz2019-09-261-11/+212
| | | | | | | | | Show an info bar entry with a one click solution to setup a language server if the python which is most likely to be used for this file has an installed language server. Change-Id: Ia52bb043b543699527740951f68cc6be546833df Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* rename PythonEditor plugin to PythonDavid Schulz2019-07-171-0/+65
The plugin does not only contain a pure editor, but all kind of support for a programming language like project and run support. Change-Id: I1251367c8db2e7a54986415ffc5b860cb210de3c Reviewed-by: Christian Stenger <christian.stenger@qt.io>