Commit Graph

397 Commits

Author SHA1 Message Date
hjk
62aa35ee39 ProjectExplorer: Remove OutputFormatterFactory hierarchy
It never gained traction, was only used in thee places, and
the class(-hierarchy) is not really needed and only complicates
the code when the formatter creation is handled in free functions.

Also adapt the users.

Change-Id: Ieef7199f5a36f244b2f38cffef71a5fe0606065c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-02-01 13:23:35 +00:00
David Schulz
8499240544 Python: Remove now unused interpreter aspect
Change-Id: I107ca665cf2fa2b707dba46917ce45f240d15654
Reviewed-by: hjk <hjk@qt.io>
2024-02-01 13:18:29 +00:00
Marcus Tillmanns
92996b74ae Python: Don't needlessly store default value
Task-number: QTCREATORBUG-24762
Change-Id: I3ca495b2696747d5323cc7eea4aac4d99e3adfd1
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-02-01 07:15:07 +00:00
Eike Ziller
acedf93ba3 Remove CommandButton
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>
2024-01-26 12:25:26 +00:00
David Schulz
d9404208da ProjectExplorer: declare only relevant aspects as features
This will disable python kits for all Wizards that require a valid Qt.

Change-Id: I4a8d6dd60629ddb556e49c067200acba8ef080d2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-26 11:27:32 +00:00
Marcus Tillmanns
a25bbf23c6 Utils: Fix error prone default value of appendOrSet
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 <hjk@qt.io>
2024-01-26 10:10:03 +00:00
Jarek Kobus
10ff747a0f Use more std::chrono and std::chrono_literals namespaces
Change-Id: Ib8c83988d7afe35d81b87ff8c5c87eef2082f12d
Reviewed-by: hjk <hjk@qt.io>
2024-01-23 09:32:43 +00:00
Jarek Kobus
afc67468e6 Process: Get rid of setTimeoutS()
Add an extra arg to runBlocking() function instead.
Use std::chrono::seconds for timeout.

Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-22 20:27:51 +00:00
Jarek Kobus
b02e708b6d PythonUtils: Remove code repetition
Introduce isUsableHelper() and use it from venvIsUsable()
and pipIsUsable().

Change-Id: I29c869f544e28d0962bc0e357399db66f48ba3d1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-22 07:40:28 +00:00
David Schulz
45ef64f4f9 Python: fix venv check
FilePath::contains only checks whether the passed string is inside the
path, and not whether the path contains a folder or file with the passed
string.

Change-Id: I20a1a9a52a9f9a436433848ac2eccd38666274d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-01-17 13:33:47 +00:00
Dominik Holland
c81efc39c8 Create RunConfiguration specific DebugWorkerFactories
Instead of relying on the DebuggerRunWorkerFactory to match for all
RunConfiguration, every plugin needs to create a WorkerFactory for
its own RunConfiguration.

Similar to the SimpleTargetRunnerFactory there is now a
SimpleDebugRunnerFactory which makes the setup easy.

Change-Id: I25aaabcd70f7ac649baeab4eb4c7e88d53dac91e
Reviewed-by: hjk <hjk@qt.io>
2024-01-17 10:17:41 +00:00
hjk
9c8e5d4cdb Python: Simplify PyLSConfigureAssistant setup
Change-Id: Icdd8d0017a8fe71f579af6f19fa2b870f0677efc
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-16 10:43:28 +00:00
hjk
5de41fb40d Python: Use new plugin items setup pattern for PythonEditor
Change-Id: Ie8516960a106ddeff415b6412d9af66f7d2f0f36
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-16 10:43:06 +00:00
hjk
1992efddfc Python: Move plugin class definition to .cpp
The plugin classes partially changed there purpose, they are no more
meant to provide internal utility functionality.

Change-Id: I9b9200995eaa95dcd924c94dcedb28e6d5db0be9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-16 10:42:45 +00:00
David Schulz
fb2fd513be Python: disable generateKit button after clicking
The button should only be enabled if no kit can be associated with the
currently selected python interpreter.

Change-Id: I0357bf999c8abd2bc11b4ac5b2e79a10a0d94f01
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-01-16 08:52:04 +00:00
David Schulz
d67379481c Python: optimize venv and pip checks
Checking for the venv and pip module can take some time. Since this is
done now whenever the kits are validated this has performance
implications for multiple actions. For example showing the target
selector wizard page or opening/switching sessions.

Use a cache to reduce the number of python processes started to check
the existence of the modules, and if the module can be found store that
info in a persistent store to avoid checking it again after a restart.

Change-Id: Ib899da0e6b2da28fbee2b5baff7f923e4595260a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-01-16 08:51:47 +00:00
hjk
052ea6d231 Python: Move highlighter and indenter class definitions to .cpp
Change-Id: Ib71d520977034ca66bd84c9188ffed5fe74e1ba0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-01-12 06:53:40 +00:00
David Schulz
76b61a7993 Python: register python infos to the kits macro expander
... and use the name in the autogenerated kits display name

Change-Id: I928533e6f8238189d64350463897a86ff5512ae7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-10 05:32:23 +00:00
David Schulz
4f857711c2 Python: install lsp into tempdir for remote interpreters
Change-Id: I4b0b1a47c73742cc14f68d80b9116fcd51224bd1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-01-08 10:42:48 +00:00
Serg Kryvonos
c3a7279f05 Work on lambdas C++20 compatibility
Change-Id: I0d391c02ae1e1c5a1751b33ca7e83902e1cfe269
Reviewed-by: hjk <hjk@qt.io>
2023-12-13 13:24:22 +00:00
David Schulz
fbe054116a Python: Avoid polluting global or virtual environments with pylsp
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 <christian.stenger@qt.io>
2023-12-13 11:26:16 +00:00
Eike Ziller
10e5a27c27 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp

Change-Id: If96d0f0a3d48c2581e765e4afb8b23924c48bdd6
2023-12-12 10:17:39 +01:00
Cristián Maureira-Fredes
c4464eb072 Add logo and title to PySide install dialog
Change-Id: I7888ee906334de2c93c24c5da2394c9e73101a28
Fixes: QTCREATORBUG-30041
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-12-12 08:51:44 +00:00
David Schulz
f4bf7c5b00 Python: show warnings if pip or venv is missing
Change-Id: Ib38c1eb3b0f31d6988d3a5f084ac6eda08ec0619
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-12-11 11:39:11 +00:00
David Schulz
d5ddf391c1 Python: optimize loading projects
Loading .pyprojects file now doesnt add a target for the default kit but
results in showing the target setup page which is filtered for usable
kits.

Change-Id: I4c407960a90a27457314281b79dc8878510eca80
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-12-11 09:33:26 +00:00
David Schulz
eb740bdd95 Debugger: add python debugger setting in run configuration
Change-Id: Ifa5d72566007e0bb006523433dcef97689677fbf
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-04 14:56:27 +00:00
David Schulz
c0a3565362 Python: Create a default BuildSystem for Python targets
This makes sure the project can be parsed even if we do not have a valid
build configuration for that target.

Amends 09e94ae4ac

Change-Id: I92214474f581af228bd5c2aaf2f3e4b620ffc9d5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-12-01 07:01:10 +00:00
David Schulz
09e94ae4ac Python: use kits page in python wizards
Change-Id: I1f7aaf145443481546abb868c8c167186600b848
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-28 12:17:14 +00:00
Eike Ziller
c77128e698 Merge remote-tracking branch 'origin/12.0'
Change-Id: I7971dd83798e975d4e10b77a352c9d7ef7b14ec0
2023-11-23 10:43:00 +01:00
David Schulz
06595222ff Python: fix commercial pyside installation
Change-Id: I6a89b9a9f32e07db91e67df248d94c78ae731455
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-21 14:03:13 +00:00
Christian Stenger
7125862212 Add some include guards
Change-Id: If306f95f206e2b1cba48df806c822b8e2d27cf72
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-21 13:58:36 +00:00
Christian Stenger
4f7865eb4d Python: Limit detection to unique python
In case we are having symbolic links on python or its parent
path(s) we added an interpreter for each of these.
Resolve the python path explicitly and only add them if they
are unique.

Change-Id: I21b9d7d85e82c5ec3a18e182dfcde2b98936a8af
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-15 12:02:40 +00:00
David Schulz
f6e403b219 Python: split buildsystem and project into separate files
Change-Id: Ic226ff6685cb6657a5e83258aab151754d80b3bf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-14 11:03:24 +00:00
hjk
fc7c11fb65 ProjectExplorer: Consolidate creation of KitAspect's "Manage..."
Change-Id: I001a21f41bcd5ff0614bdf98893b56137c06546f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-08 09:52:26 +00:00
Jarek Kobus
4c38f68d0f TaskTree: Rename StopWithDone -> StopWithSuccess
Make naming consistent with recent changes.
"Done" is meant to be an event name when the task / group
finishes. "Done" may finish with "Success" or an "Error".

This addresses the 26th point in the task below.

Task-number: QTCREATORBUG-28741
Change-Id: I53ed6905b1c385c398f49e122e8ca60aa3ad0806
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 14:09:23 +00:00
Eike Ziller
f9d4697371 Merge remote-tracking branch 'origin/12.0'
Change-Id: Ice9c78147917fc13b6cf81ba781a37bdcd870e17
2023-11-03 14:58:00 +01:00
David Schulz
024f653806 Python: initialize run configuration with kit python
Change-Id: I85ebe906bee2d9bc88c443f0189a685ac97ee30d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-03 08:09:17 +00:00
David Schulz
f5e12237a2 Python: avoid detecting pythonw on windows
Change-Id: I75fcba53fa671904405d3411409c6ea67335e81b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-03 07:37:54 +00:00
David Schulz
b2cb87f06e Python: add a python kit aspect
Change-Id: If7aaa52025ec5834a44e9196548fbcc7456c89a8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-02 09:18:19 +00:00
David Schulz
28b70672b4 Python: generate Python kits for new interpreter
Change-Id: Ie4b23aae296f66900fba85a9e243bbf656e49ed4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-02 09:08:14 +00:00
Christian Stenger
b39476dd47 Python: Avoid warning in QFutureWatcher
Re-using a watcher will trigger the warning as the future had been
set on the "old" watcher even though it may have finished or
disconnected.

Change-Id: I32d937b1d73d8bba9ec5639c62393da84638099e
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-01 07:07:52 +00:00
David Schulz
0117b1669b Python: use correct python language server after installation
Change-Id: Ie5e26eedffc51e8916d849121fa60ea3d56e5a66
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-30 09:44:22 +00:00
Eike Ziller
ad7d559028 Tr: More small fixes
Change-Id: I5d9324d3f64eaa522fa1d435efa39fa43d84798a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-10-18 12:10:45 +00:00
David Schulz
18c00cd381 Python: reduce freezes in settings page with remote interpreter
Do not check the existence of remote interpreters when opening the
settingspage since we could run into device timeouts for unreachable
devices.

Change-Id: I5d0d1316961fc4ecbd2be55f6df70091ff65ecd5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-18 09:53:45 +00:00
David Schulz
ed6595a66e Python: improve pyside tool detection
Look right next to the used python. For virtual env setups this should
be a lot faster than asking pip for the installed files. Additionally
this should work for pyside devenvs.

Change-Id: I2a8cf6877636785453426c348cfac252645aa4e1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-29 09:19:52 +00:00
Eike Ziller
a0a4d9024e Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/python/pyside.cpp

Change-Id: I1f84ed56d38355cef6076797c72693fff4c1aa78
2023-09-28 11:02:38 +02:00
David Schulz
51a406900c Python: fix installing PySide wheels on Mac
Change-Id: I3f9f9ee5580176a65ca8e6b5c62b793fed170462
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-28 08:43:21 +00:00
David Schulz
b9e327bb10 Python: read installer settings for pyside wheel requirement
This should be more stable than relying on a specific folder structure
in the Qt Package.

Change-Id: I20dea176df43c9f6e768f4db69ac4eb70633f01a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-28 08:42:50 +00:00
hjk
342e066886 Utils, all: Standardize on QtcSettings
Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 13:25:31 +00:00
David Schulz
2c298097e9 Python: detect pythons async
Change-Id: I74484a4f2c33c4fd7754f87bfbf3b9d711542741
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-09-27 12:08:36 +00:00