Add the new setting: create poetry env in the project.
Merge-request: IJ-MR-149143
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
(cherry picked from commit ed85efe339518cdf6949752be286172113931c22)
IJ-MR-149143
GitOrigin-RevId: 3a682aac846e4a80e8310a3dcc0a5f1c988d28e2
Fix poetry executable detection for the "Add new local interpreter" panel.
There was a problem in `ModalityState`, which prevented updating `state.poetryExecutable` from EDT.
Merge-request: IJ-MR-147485
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
(cherry picked from commit 43a807c20f8572bcf570121792269d6ee0c67acd)
IJ-MR-147485
GitOrigin-RevId: fab1de5a2a55e62ff66790defb033b7745259dc5
1. lots of funs now `suspend`
2. errors reported to `ErrorSink`
3. validation improved (yet, still not perfect)
4. tests added
GitOrigin-RevId: 5cbf674a70ad0e0b40180dd358398bf498d6f76d
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
Try to install Poetry and Pipenv if they are not found
Merge-request: IJ-MR-141839
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
GitOrigin-RevId: 535426090df23b358ba61a9e21c2f0954c201945
Previously, such names were visible only on so-called "extended" completion,
activated when the hotkey for the basic completion was hit twice. The main reason
was that collecting such variants from indexes was a slow process, and we
didn't want to harm the responsiveness of completion for basic names.
Now it becomes possible thanks to a number of performance optimizations:
* Instead of using three separate indexes for classes, functions and variables,
we use one -- PyExportedModuleAttributeIndex. By definition, it includes only top-level
"importable" names, so we additionally save time by not filtering out irrelevant
entries. Also, it doesn't contain private definitions starting with an underscore.
It might bother some users, but given that the previous completion was used
extremely rarely, and the new one is going to be visible everywhere, it seems
that pruning unlikely entries as much as possible is a fare tradeoff. In the future,
we might enable them back on the "extended" completion if there is a demand.
Also, this index binds its keys to the project (`traceKeyHashToVirtualFileMapping`),
further eliminating useless index lookups.
* Thanks to the recent fixes in the platform (IJPL-265), it's now possible to
simultaneously iterate over all keys in an index and request values for a given key
without deadlocks, which is much faster than eagerly fetching all keys first.
* While scanning through all matching entries from indexes, we terminate
the lookup if the number of items exceeds the size of the lookup list.
We can further reduce this number by adjusting the "ide.completion.variant.limit"
registry value.
* Calculating expensive "canonical" import paths (e.g. "pkg.private.Name" is importable as
"pkg.Name") is offloaded to a background thread thanks to the `withExpensiveRenderer` API.
We still calculate these paths synchronously, though, for names whose raw qualified names
contain components starting with an underscore to decide whether these private names are
publicly re-exported and, hence, should be displayed.
The rest of the work has been put into reducing the number of entries on the list, e.g.
* The prefix under caret is now matched from the beginning of a name, e.g. `Bar<caret>`
matches `BarBaz`, but not `FooBar`.
* We don't suggest imported names clashing with those already available in scope.
* Some kinds of definitions are not suggested in specific contexts, e.g.
functions and variables are not suggested inside patterns and type hints.
* Nothing is suggested at the top-level of a class body, where dangling
reference expressions or calls are not normally expected.
Additionally, we don't suggest names from .pyi stubs at the moment, because
it pollutes the suggestion list with entries coming from the stubs for
third-party packages in Typeshed. We should probably enable them back once
we are able to properly disable Typeshed entries for not installed packages.
Some legacy forms of completion are left in the extended mode. In particular,
qualified names of classes are offered inside string literals only in this mode.
Also, module and package names are suggested only in the extended mode, because
top-level packages and modules are already suggested for the basic completion
by PyModuleNameCompletionContributor.
A few tests in PyClassNameCompletionTest were updated or removed entirely because
* we no longer suggest private names
* we no longer suggest names from private modules not re-exported in a public module
* we no longer suggest names clashing with those already available in scope
* prefix matching policy was changed to start at the beginning of an identifier
The whole feature can be disabled with the option "Suggest importable classes,
functions and variables in basic completion" in settings.
GitOrigin-RevId: 0787d42ce337b73b01a60f0bb7aa434fee43e659
Make it possible to expand/collapse overloads by clicking the action link in the bottom component or calling Parameter Info window on the same place for the second time.
GitOrigin-RevId: a65de4124b4530dd9cc5f16b0a709e3a6489071c