Commit Graph

744 Commits

Author SHA1 Message Date
Ilya.Kazakevich
5666495862 PY-77813: Report new project type broken in NPW.
FUS statistics consists of two parts:
1. Interpreter (i.e "venv" or "conda")
2. Project generator type ("Django" or "Flask")

`com.jetbrains.python.newProjectWizard.collector.PythonNewProjectWizardCollector.GENERATOR_FIELD` was a class without any limitation and `DirectoryProjectGenerator` instance was reported (i.e one for Django).

When migrated to NPW, we:
1. Dropped most old generator classes
2. Called this function providing `this::class` by accident, and it was `CoroutineScope`, so we finished with lots of `CoroutineScope` as generator type in FUS.

We must:
1. Provide old names for project types to preserve statistics.
2. Make it type-safe this time.

We also found that interpreter statistics is nullable for `PySdkCreator` which isn't true: SDK creation statistics is always not null.

So we:
* Introduce interface for project generators that reports "name for the statistics"
* Implement it both for DS and PyCharm by returning class name by default
* Overwrite it for several well-known generators to preserve statistics (use old named of now-deleted classes)
* Make interpreter statistics not null.


(cherry picked from commit bdfa73ba043d3584c6ba1871bca7a464a550bc21)

KT-CR-19191

GitOrigin-RevId: 53f874c18d67d33083cf8508a58be257b5e89ab7
2024-12-04 01:39:37 +00:00
Ilya.Kazakevich
9f31575c35 PY-77483, PY-75549, FUS-5195: Misc project pycharm (squashed commits from master)
Lots of files are picked from the master

GitOrigin-RevId: 88dfc699cbfa2be9b11d1645c2c24221d16fbdc4
2024-11-26 17:47:29 +00:00
Vladimir Koshelev
c0b3f1bdab [pycharm] remove what's new from 243
GitOrigin-RevId: d99daca2141ca04a4be4a537ea2954246ef39c8c
2024-11-18 14:08:23 +00:00
Egor Eliseev
dbee69ed0b PY-59838 Refactor Poetry package management
Associate poetry files ("poetry.lock", "pyproject.toml") with the Python Packages toolwindow.
Separate UI error handling from package management logic.
Add tests to check the installation and removal of packages using poetry and "pyproject.toml" modification.

Merge-request: IJ-MR-146002
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 2ab0816f10c970f738d6d931dc123481030cad38)


Merge-request: IJ-MR-148435
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: be957c5343b73264c78134f156ad0e4034b912f9
2024-11-11 15:50:51 +00:00
Ilya.Kazakevich
75801d4c3e PY-75910: Update project name automatically in NPW even if field is hidden.
`getComponent` accepts `projectPathField`.
We use `ProjectPathProvider` to update project name from this field.

V2 panels are also affected: they now share logic (`ProjectPathFlows`) with project name component.

See `com.jetbrains.python.newProjectWizard.projectPath`

GitOrigin-RevId: f7b306fbbd9777925274513effd56009a0614f9a
2024-09-30 05:41:30 +00:00
Ilya.Kazakevich
3689a45984 Python NPW and Add SDK refactoring:
In SDK:
* `v1`: legacy API that should be dropped (but still used by Python Plugin and DS)
* `v2`: slightly better API used both for new project and interpreter settings. Supports DSL UI validation. Must be adopted by DS and Python Plugin somehow.

In NPW:
* `newProject`, `newProject/steps` (aka `v1`) deprecated, used only by DS and Python Plugin.
* `newProjectWizard` (aka PyV3): the right new API to use. Sooner or later will be adopted by DS and Python Plugin

GitOrigin-RevId: c3d49ce95079dc5ba589955381ddfe42326295fd
2024-09-23 21:14:22 +00:00
Egor Eliseev
e6f654da72 PY-75932 Poetry: the endless process of creating an interpreter
Make Module.isPipenv/isPoetry only readable.
Create SdkAdditionalData when creating new sdk.
What made it possible to delete the dangerous function PySdkExt#setCorrectTypeSdk.


Merge-request: IJ-MR-145160
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 657092ed87f9948ada5aa2ffacfea0653a482ac7
2024-09-21 18:09:26 +00:00
Lev Serebryakov
0b6ba6a94d IJPL-149317 More explicit locks.
GitOrigin-RevId: 95f64ac7da5066d2efb212d4e7cfc2cb98543ac1
2024-09-19 01:21:03 +00:00
Tagir Valeev
0262382d71 ModuleBuilder.getModuleType inheritors: raw type removed
GitOrigin-RevId: 454b9c1543c29e27cdb1c1656d9be82afd4d769e
2024-09-16 11:23:15 +00:00
Ilya.Kazakevich
379719b7ea PY-75868: NPW: Simplify API to customize new project name.
All generators share the same logic, only providing `newProjectName`.

Python PyV3 generators use generator name by default.

GitOrigin-RevId: ffcb56a1bd2beaad1c7693550036aa091fa05a2b
2024-09-12 19:30:16 +00:00
Ilya.Kazakevich
3891dfa89c Python: Remove unused symbols
GitOrigin-RevId: edd7cb575cc1c116de22c9e5b7331d6e413f62dd
2024-09-12 07:24:18 +00:00
Ilya.Kazakevich
6a9aebe3e6 Python: introduce failure as a sugar over Result.failure(Throwable(userVisibleText))
GitOrigin-RevId: cefb5234d830f4e306e385161dd07d35eb12989b
2024-09-11 23:49:58 +00:00
Ilya Kazakevich
7bd141a993 PyCharm: Rewrite NPW API: See com.jetbrains.python.newProjectWizard
This package (aka PyV3) fixes several issues, including
1. Lots of `DirectoryProjectGenerator` misuses: We now create UI and settings with `ProjectGeneratorPeer`: no more manuals casts in callback
2. Decouples project generation from UI: Settings aren't aware of UI but generate a project instead. Settings are mapped to the UI using Kotlin DSL UI
3. Kotlin DSL UI panel enables validation
4. `PySdkCreator` (an interface implemented by all "v2" SDK panels) now accepts `Module`, so we can provide it Poetry

The whole machinery of `PythonGenerateProjectCallback` (a pack of manual casts only mother could love) is completely deprecated and will be removed soon.

Lots of small changes towards `suspend` functions, Kotlin DSL UI and `Flow` decrease the technical debt.


Merge-request: IJ-MR-144503
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: 21963e843b0ae67c71a6fc5ea1229cb0f57915a9
2024-09-10 19:50:12 +00:00
Roman Shevchenko
a5666abead [project] pruning FileChooserDescriptor overrides (IJPL-150176 prerequisite)
`BrowseFolderRunnable` and `*WithBrowseButton` family: getting rid of separate "title" and "description" parameters in favor of the chooser descriptor object, to avoid cloning the latter down the road.

GitOrigin-RevId: 33ec5968a1db953c60848974135055c288accf85
2024-09-06 11:41:43 +00:00
Aleksandr Sorotskii
c62161061c PY-75319 fixup python package installation during initial config. cleanup creating virtualenv remove duplicate code
(cherry picked from commit f5bbfd705e248f431d30f0599f063c569996a1a3)

IJ-MR-144037

GitOrigin-RevId: 90868fc260667b71c3a2f82985e6016c6bf8354f
2024-09-05 16:58:17 +00:00
Gregory.Shrago
8baa88cb45 register group via group tag: welcome screen
GitOrigin-RevId: 2b2511880bddbfc08543e21c4818b4eca0dfcf5e
2024-09-03 01:56:34 +00:00
Andrei Iurko
f65c970d2d [qodana] QD-9527 Enabled Poetry SDK creation for Poetry projects in headless mode
GitOrigin-RevId: edaab8de048359a95a197989fb2c53068dd21f3e
2024-08-28 13:11:34 +00:00
Ilya Kazakevich
bc2d1d84f4 AbstractNewProjectDialog refactoring:
All implementations use `AbstractNewProjectStep` and any other action wouldn't really work.

We deprecate old method and force users to use new (the one that returns `AbstractNewProjectStep`).

Some methods are finalized because overwriting them might break the contract


Merge-request: IJ-MR-142822
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: aafa6fb336f78391077773ac6d202d35c15a8c8d
2024-08-19 17:11:21 +00:00
Ilya.Kazakevich
ff08bc9792 Python: Unused symbols removed
GitOrigin-RevId: f43c1deb044e53c235647f0b7fec041cc598cd63
2024-08-16 04:48:22 +00:00
Ilya.Kazakevich
1afc7baee6 Python: Unused symbols removed
GitOrigin-RevId: 02819bca784cd3176ccfd3aa6af085a0da579a18
2024-08-16 04:06:33 +00:00
Ilya.Kazakevich
9a1c6c936d Python: Type bound added
GitOrigin-RevId: 6ee8e4d3ac316e115874cebef9d4a6b69ca04b9a
2024-08-15 23:11:22 +00:00
Ilya.Kazakevich
d74ffab3ba Python, DS: Use the new interpreter configuration UI to unify it between DS and PyCharm.
GitOrigin-RevId: 9faec46e4265e4a085c8f6acabee78551360c6a4
2024-08-14 17:47:00 +00:00
Vladimir Krivosheev
86b23d40f1 IJPL-197 introduce core-only or allowlist-only ApplicationActivity
GitOrigin-RevId: cb3631d0748100134dc8a6021dac1a2f57859121
2024-08-14 13:08:53 +00:00
Ilya.Kazakevich
b1a4c55771 Python: VirtualEnvReader refactoring: move the same module as PythonSdkUtil, and substitute a couple of methods.
`PythonSdkUtil` duplicates VER logic. One Jython-specific thing was also removed as we do not need Jython anymore

GitOrigin-RevId: 658fc42b485ac074a6d89fce3c7408e51cdc8f95
2024-08-12 20:54:06 +00:00
Daniil Kalinin
3e43684ba4 PY-73906 Sunset the old PyCharm Pro advertisement implementation
GitOrigin-RevId: d26c1a980b4827932bc28e11d04c28726cdd14f7
2024-08-08 09:20:09 +00:00
Ilya Kazakevich
b2fa3aee5a Introduce ModuleOrProject and provide it to the interpreter creation machinery.
Interpreter creation logic might work against a project or a module. In the latter case a project is a module field.

See `ModuleOrProject` for description.

We also added logic to the `PythonAddLocalInterpreterPresenter.basePathForEnv`: it now uses module root if possible.


Merge-request: IJ-MR-141583
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: 0ef23feb6a2407331c48b9b69caabefc8625a455
2024-08-05 14:33:51 +00:00
Vladimir Koshelev
c04b280ded [pycharm] what's new: fix plotly action id
GitOrigin-RevId: 79c8be153b10e0adc3943a1324aff9edcbfa1a91
2024-08-02 18:05:36 +00:00
Vladimir Koshelev
6cf2ecefcc [pycharm] update vision pages and add a separate vision page to CE
GitOrigin-RevId: 26018648c26cbbbe618aeacdea73567835718b27
2024-08-01 12:25:31 +00:00
Aleksandr Sorotskii
56b48787e3 cleanup, remove dead code
(cherry picked from commit f7912b44dc75c228a9c763cf0b517d3aee0ea483)

IJ-MR-141257

GitOrigin-RevId: 095827de20dd1c2dd83dd8eedb6b40a9bb3c8a64
2024-07-30 00:05:20 +00:00
Egor Eliseev
2a8c477af2 [python] Poetry refactoring
Splitting a huge file `poetry.kt` into several


Merge-request: IJ-MR-139484
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: ea51232c4795538400f3cbbe159850e1c4252ac5
2024-07-26 11:54:03 +00:00
Vladimir Koshelev
5482951755 [pycharm] adjust promotion for the community version
GitOrigin-RevId: 3ba3b76c52615dfb9a62c4f94e8da7226ce541e9
2024-07-25 11:09:29 +00:00
Vladimir Koshelev
749b8039d5 [whatsnew] update pycharm2024.2.json
GitOrigin-RevId: a6e60eaee38c62e0e3542b69a9b05d5af733e152
2024-07-25 11:09:29 +00:00
Vladimir Koshelev
eb71087383 [pycharm] add productivity action to what's new
GitOrigin-RevId: 718b34e3b9dee8146891358096fc857c1a37d77e
2024-07-25 11:09:29 +00:00
Aleksandr Sorotskii
f3082fb053 Persist associate path changes. Cleanup association logic a bit; PY-72692
(cherry picked from commit a3ee1feb4f98f0f66760762819800bbc6342bd08)

IJ-MR-140559

GitOrigin-RevId: dbff236b7fbe20b23d6dea7b324a3f1ac031d2d6
2024-07-23 13:25:57 +00:00
Nikita.Ashihmin
3c5b6a8592 PY-74000 PyCharm 2024.2 in-product what's new // Add to whats new
GitOrigin-RevId: bc22a2eef5aa7fd611ed740553ef9a6c3a0a95b7
2024-07-22 23:17:37 +00:00
Vitaly Legchilkin
8d7b0f9039 [python] fix 'Check out the Endpoints tool window' link using ActivateEndpointsToolWindow action (PY-73955)
+ reformat pycharm2024.2.json

GitOrigin-RevId: 11905d658145a003947d276677f7c0ce04c1006f
2024-07-19 16:45:27 +00:00
Ilya.Kazakevich
ac673868e5 One more iteration to replace null with Result not to suppress errors.
Lots of code returns `null` without any reason. This ill pattern covers errors effectively making it impossible to find the root cause of any problem.

We replace `null` with `Result` to log and report errors.


Merge-request: IJ-MR-139850
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>

GitOrigin-RevId: 7cbb173f672a44a98f24e89e247428ab6e8ca01d
2024-07-18 16:07:28 +00:00
Ilya.Kazakevich
6c7ce9ade4 Refactor setupSdk not to catch errors.
Errors have to be processed by caller, not by logging nor swing messages in a function itself.

GitOrigin-RevId: b617810835f41c6874c776a2a5762d7402123336
2024-07-12 19:18:13 +00:00
Nikita Pavlenko
f87a1466b3 [PyCharm] Jupyter (fix): intellij.jupyter.core module is now pure v2 module, and propely included to everywhere. #PY-73770 Fixed
GitOrigin-RevId: f990cb2ff9e32a38565d4d25975a7c9929880dfa
2024-07-10 10:50:42 +00:00
Vladimir Koshelev
b7700aaf66 [pycharm] PY-64403 add vision file to PyCharm
GitOrigin-RevId: 7b3fd4492e0cebb313626c7a1b52e369e0577279
2024-07-08 18:25:33 +00:00
Vladimir Koshelev
9bdf1de9e2 [python] move code vision elements to the right side by default
GitOrigin-RevId: 53c4dab7ad7e3569000675961ec8d45a6733bc1c
2024-07-01 09:41:26 +00:00
Egor.Eliseev
0c73c9eff9 PY-72274 separating content for python core/pro plugins
1. Delete `intellij.python.community.impl.xml` (move content to `PythonCore` plugin). It is necessary to fix incorrect dependencies: `PythonCore`, `Pythonid` include the same module.
2. Fixed dependencies: if some plugin/module needs Python core functionality, then it should depend on `PythonCore`.


Co-authored-by: Vladimir Koshelev <Vladimir.Koshelev@jetbrains.com>

Merge-request: IJ-MR-136158
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: ce9ed4c17f601ee1ca2b6cf608f4e30fdac1d879
2024-06-19 21:39:24 +00:00
Alexander Lobas
3f90c0e90f IJPL-49419 Move old UI to plugin
GitOrigin-RevId: 0ebbb04fd33b7663c08303a1e3f56057fa8884d9
2024-05-12 09:25:36 +00:00
Vladimir Koshelev
ce5999a4af [PY-64403] move WhatsNew from rider to a platform module
Merge-request: IJ-MR-131247
Merged-by: Vladimir Koshelev <Vladimir.Koshelev@jetbrains.com>

GitOrigin-RevId: 73c9a19763d4f770d73da9223abd41368aca6a1d
2024-05-03 16:21:12 +00:00
Andrey Vokin
06cf1ece7c PY-71860: make "AI Assistant" toolwindow available when promote aciton invoked
GitOrigin-RevId: 3ed03db935991f8007b83965a9ea82a2677ef897
2024-04-23 20:25:43 +00:00
Dmitry Batrak
881b370b95 RDCT-1092 Hotkeys are displayed incorrectly in popups on different OS
replace SystemInfo.isMac with ClientSystemInfo.isMac() in keyboard-shortcuts-related code

GitOrigin-RevId: 640604dff8e09d1aeccd0edc156873dd63c09fea
2024-04-22 19:16:22 +00:00
Andrey Vokin
7c54716a66 PY-71860: make possible to disable AI Completion Action promoter
GitOrigin-RevId: 8acdb5947e990e67013c3f4b4ccbdda05c2e03bb
2024-04-19 20:14:17 +00:00
Andrey Vokin
1cc5303a3a PY-71860: AI Actions promotion
GitOrigin-RevId: 52648b965e5663a8420cf63bfa30f12de24a8b10
2024-04-18 22:30:53 +00:00
Andrey Vokin
4b947848b9 PY-71860: add AI Completion Promotion to PyCharm Community dev build
GitOrigin-RevId: 52407e14cf42d5a071e7fc086e2cef0d3a3a9020
2024-04-18 22:30:48 +00:00
Andrey Vokin
6fd89125f9 PY-71860: add AI Completion Promotion to Settings of PyCharm Community
GitOrigin-RevId: e4741fd50d0e24308a9566a07c135dd1feadfbf1
2024-04-18 22:30:37 +00:00