Commit Graph

30004 Commits

Author SHA1 Message Date
Tagir Valeev
ac6e041167 Remove groovy-stdlib dependency where unused
GitOrigin-RevId: ecbe272c09c97517177b2214479f2644c1ef3229
2024-10-08 09:28:42 +00:00
Gleb Marin
09c2b90e35 [ml imports ranking] Anonymize number of files in py project
FUS-5036 Change group "pycharm.quickfix.imports"


Merge-request: IJ-MR-146185
Merged-by: Gleb Marin <Gleb.Marin@jetbrains.com>

GitOrigin-RevId: 278f9c703398a18bc47d2c724d44f12e9ec3610e
2024-10-07 14:14:08 +00:00
Yuriy Artamonov
b79a859047 [java] IDEA-352641 File - New contains many irrelevant templates for Java source sets
GitOrigin-RevId: bd18866f6d60839fa9474c7071aca2761989986e
2024-10-06 17:03:10 +00:00
Vladimir Krivosheev
4a176d4c02 IJ-CR-146078 extract intellij.platform.bootstrap
GitOrigin-RevId: b79efc92829111228e83058e54381d8e02116b6f
2024-10-05 22:01:55 +00:00
Nikolay Chashnikov
88f5f288f9 [python] API cleanup: remove unused deprecated API (IJPL-156972)
GitOrigin-RevId: 57adfe085fe2b77e3c608ba1230688c35b5615d0
2024-10-04 17:44:12 +00:00
Daniil Kalinin
440e53f50b PY-76362 Correctly resolve TypeVar from typing_extensions
GitOrigin-RevId: 9318c0f8b4eece25a427129db7cdcecdf7767dbe
2024-10-04 14:48:11 +00:00
Ilya.Kazakevich
00864df050 Python: Run wait fo external process on IO
GitOrigin-RevId: 6f4fbe85294a5f0aa7c8ec1e8b8a4be03628bdb4
2024-10-04 12:53:13 +00:00
Alexey Kudravtsev
fa88174b0a allow python quick fix tests to change document during highlighting
GitOrigin-RevId: f69e2b152a473941411e1574c79235c50e5e8922
2024-10-04 12:14:40 +00:00
Ilya.Kazakevich
87f4e387b2 Python: Unused symbols removed
GitOrigin-RevId: 0fad739d17679c12565078dc776fa928f85bbfa5
2024-10-04 04:32:16 +00:00
Ilya.Kazakevich
ae6bda01df Python: Make createVirtualenv suspend, process error and cover with tests.
We now fail silently in case of any error. This commit fixes it.

GitOrigin-RevId: 76977843a892dd450d8292378a7cefb522cb78c1
2024-10-04 01:08:48 +00:00
Vladimir Krivosheev
2af05dec25 extract intellij.platform.ide.internal
GitOrigin-RevId: 0e5e80fd53c3ef15ed9835a9400381d383526ca3
2024-10-03 19:22:03 +00:00
Ilya.Kazakevich
ff33887a25 Python: Close classes that aren't part of the public API.
`PySdkToInstall` breaks LSP and will be deleted soon. Do not use it

GitOrigin-RevId: 1dd7ede18ac1f92aafffd03d7b50fcd922c4b226
2024-10-03 16:09:40 +00:00
Daniil Kalinin
783bbde096 PY-75760 - allow reference to another ParamSpec be default of ParamSpec type, simplify logic of generic substitution for TypeVars
GitOrigin-RevId: 9ca5d7f3529513c683424d2f4d6da75f40d58e4a
2024-10-03 12:19:06 +00:00
Daniil Kalinin
d29d55476e PY-75760 - adjust testTypeVarParameterizedConstraints test
Sacrifice this old test for a good cause. The inferred type of `my_list_t1` is now `List[null]` which matches with pyright - it also has no complaints in the changed fragment

GitOrigin-RevId: 2176ffa69c6a24ec55344f4294e04542185ca7e7
2024-10-03 12:19:06 +00:00
Daniil Kalinin
411f2af7ba PY-75760 Refactor the implementation of PEP 696 support - Tests
Change the expected type of `testNewStyleTypeAliasOneWithoutDefault` test (now it is the same as in pyright)
Add the same tests but using old-style type aliases

Add a couple more tests on aliased types for some tricky cases

GitOrigin-RevId: 9d289d8e0964c592f4282f9970eeb9a08a8105e5
2024-10-03 12:19:06 +00:00
Daniil Kalinin
c5b81e03f3 PY-75760 Refactor the implementation of PEP 696 support - Type Aliases
Refactor the logic of inferring aliased types according to the previous refactoring

GitOrigin-RevId: c03a1533eee0fa6f45fa0f3c2b9ced5e7cc3c336
2024-10-03 12:19:06 +00:00
Daniil Kalinin
23cee33c35 PY-75760 Refactor the implementation of PEP 696 support
1. At first, get rid of the explicit mapping of generics to default types (remove all these not-good-looking methods which were added earlier, such as `PyTypeChecker.trySubstituteByDefaultsOnl`y and `PyTypeChecker.getSubstitutionsWithDefaults`) and their usages. All the related logic now will be handled in `PyTypeParameterMapping`, as we wanted it to be.

2. Do some changes in `PyTypeChecker` to be able to correctly parameterize class via constructor call, and also take defaults into account in `PyTypeChecker.getSubstitutionsWithUnresolvedReturnGenerics` for methods

3. Get rid of the explicit calls of `PyTypingTypeProvider.tryParameterizeClassWithDefaults` in `PyCallExpressionHelper`, `PyReferenceExpressionImpl`, rename this method to `parameterizeClassDefaultAware` and call it directly in `PyTypingTypeProvider.getReferenceType`

4. Add a new flag to `PyTypeParameterMapping` to be able to correctly match type parameters (see `PyTypeChecker.matchTypeParameters`)

GitOrigin-RevId: 5dd90ee3bdf8319b36f1945ce22a33a8edf6bc93
2024-10-03 12:19:06 +00:00
Egor Eliseev
15f26f8d9f PY-65295 Poetry installation
Rewrite poetry installer.
Add a new test for installation using poetry_installer.


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

GitOrigin-RevId: 0f9802a7c6f0d2c6e46b496915b972e618cd80b3
2024-10-03 12:12:57 +00:00
Vladimir Krivosheev
26c94d85b0 extract intellij.platform.ide.remote
GitOrigin-RevId: 9d68fda3031f89d5b0207782e796a54f24683176
2024-10-03 09:58:11 +00:00
ekaterina.itsenko
cefb5228e1 [pycharm] PY-72208 Tables(Jupyter, SciView): Refactoring, fix tiny errors
GitOrigin-RevId: a936672fbdf51c9692150bd7c78721988abde3f7
2024-10-02 19:17:45 +00:00
ekaterina.itsenko
2b3832d5a9 [pycharm] PY-72208 Tables(Jupyter, SciView): Add registry, refactoring
GitOrigin-RevId: 937c9127a008028ad63f0f2d04b14bf972dbcab0
2024-10-02 19:17:45 +00:00
Pavel Karateev
85c6eee402 PY-75714 Fold single line match case clauses
Merge-request: IJ-MR-144163
Merged-by: Pavel Karateev <Pavel.Karateev@jetbrains.com>

GitOrigin-RevId: 352d1111988371b6edd9fa1af71b345dbb7aee38
2024-10-02 15:01:14 +00:00
Mikhail Golubev
190a55438e [python] Special-case typing.Generic while calculating a class MRO
typing.Generic is a magical class that can be specified in any position
in the list of base classes, not affecting the MRO consistency. It's done by
the custom __mro_entries__ implementation in typing._BaseGenericAlias (Python < 3.12),
which skips this Generic entry if there are other generic classes following
it on the list of superclasses. Namely, it's possible to do the following:

```
class Base(Generic[T]):
    pass

class MyClass(Generic[T], Base[T]):
    pass
```

which would cause a TypeError for regular classes. Since it broke our implementation
of the C3 algorithm in PyClassImpl.getMROAncestorTypes, we now special-case it by
always moving typing.Generic to the very end of the base class list while constructing
MRO.

See https://github.com/python/cpython/blob/3.11/Lib/typing.py#L1298 for a pure-Python
version of typing._BaseGenericAlias.__mro_entries__ and a relevant discussion in
https://github.com/python/cpython/issues/106102.

GitOrigin-RevId: e7d765193d532ab8457133e8fb5ad06840d89225
2024-10-02 14:29:04 +00:00
Mikhail Golubev
5622587ae3 PY-76243 Add an extra test for an explicitly parameterized conditionally defined type alias
GitOrigin-RevId: c15c9d4d8edd36f5acc8ada8935c79e787b4bc3e
2024-10-02 14:29:04 +00:00
Andrey Vokin
e3d5629229 PY-75580 Experiment with extended completion
GitOrigin-RevId: ae24082e7b57ea55e35e64b27b26751ec79cdc1d
2024-10-02 14:20:30 +00:00
Roman Shevchenko
69479687e5 [project] replacing FileChooserDescriptor#isFileVisible with file- and/or extension-based filters (IJPL-150176)
GitOrigin-RevId: 7176005f3d39d2f2e928c2e5f804de173e5d83f4
2024-10-02 09:28:56 +00:00
Nikita Pavlenko
382b256f33 [PyCharm] PY-75914 Jupyter (feat): From scientific.py.tables also removed dependency to intellij.notebooks.visualization. Added suggestion to install Jupyter to view rich tables.
GitOrigin-RevId: 705a0f5f7883517da51da0f0c532eb90fd50e5ac
2024-10-01 13:04:25 +00:00
Nikita Pavlenko
0220055ba2 Rename .java to .kt
PY-75914

GitOrigin-RevId: 7155ea08cf1a6a74492942cd0c84b377ab50c6f3
2024-10-01 13:04:25 +00:00
Daniil Kalinin
b934cfe38a PY-74231 Fix false positive "Statement expected, found Py:DEDENT" for a nested type alias
GitOrigin-RevId: 03d64abe2c949a5912eb5c16ef48a5149568d66f
2024-10-01 11:43:14 +00:00
Ilya.Kazakevich
d1446af5c6 Duplicate entry removed
GitOrigin-RevId: d2c25a22a1d3d681fe738962a5c2928755525536
2024-09-30 23:35:22 +00:00
Roman Shevchenko
9b43719207 [project] reviewing use of file-based filters in choosers (IJPL-150176)
... and amending/replacing them with extension-based filters where possible

GitOrigin-RevId: 422e4f42ac96c295a707eae76ef25686753fc6ce
2024-09-30 20:14:03 +00:00
Mikhail Golubev
e2d7d259e9 PY-76243 Don't build implicit union types for conditional definitions and names imported from stub packages
Also fixes PY-59014, PY-39761.

PyResolveImportUtil returns both .pyi stubs and the corresponding .py files for stub packages
to support partial stub packages. See the line:

```
groupedResults.topResultIs(Priority.STUB_PACKAGE) -> firstResultWithFallback(groupedResults, Priority.STUB_PACKAGE)
```

in PyResolveImportUtil.filterTopPriorityResults.

It means that, for instance, resolving the QuerySet name in type hints led to QuerySet
definitions from both places. Then, PyTypingTypeProvider.getType() for the reference expression
"QuerySet" returned a union type containing PyClassTypes for both of them, we couldn't parameterize
it in PyTypingTypeProvider.getParameterizedType and returned Any.

It's wrong that while evaluating type hints, we interpret multiple declarations as
a union type. Those should only be explicitly expressed with typing.Union or "|" operator.
This behavior was originally added in PY-18427 as an ad-hoc way to support version checks
for type hints, but now it seems detrimental because it's unclear how to parameterize
such implicit unions of generic types then.

Other type checkers also don't treat conditional definitions like that. For instance, for
conditional type aliases, Mypy complains about the name being defined twice and then uses
only the first definition, and Pyright doesn't consider names under conditions other than
version checks as valid type aliases at all. Both type checkers also support partial stub
packages properly.

GitOrigin-RevId: 1ecc7ab5d09625d10850ddc0e1f7761332ccddd5
2024-09-30 13:32:14 +00:00
Andrey Lisin
86a44e2b79 PY-72239 Cleanup: replace deprecated ImmutableSet.of with Collections.singleton
GitOrigin-RevId: 4d223701e964f19107d23ebcfeec8b86ab83210b
2024-09-30 11:02:49 +00:00
Andrey Lisin
aae7c6e856 PY-72239 Fix Python data viewer env-tests
GitOrigin-RevId: 19d66d158a367e98b1eead93955fcdea11f35e0d
2024-09-30 11:02:49 +00:00
Andrey Lisin
042bff72e7 IJ-CR-143143 Remove @RequiresBackgroundThread annotations due to many broken tests
GitOrigin-RevId: 1e8a4a9d91626d0eb80534e992747155c745bbd5
2024-09-30 11:02:49 +00:00
Ilya.Kazakevich
15709df0cc typo fixed
GitOrigin-RevId: f649d77a0f135deebcdcb2133e55be6775576abd
2024-09-30 05:41:30 +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
Andrey Lisin
e85873223b IJ-CR-143143 Fixes after review
GitOrigin-RevId: e92672f9954e57a3115eca978d3589600ce072be
2024-09-29 20:09:16 +00:00
Nikita.Ashihmin
b25b4c9950 PY-76193 PyInstall(fix): No missing package warning when only one package is missing
GitOrigin-RevId: f753108a4392afdf7996f73e10becb4fd7b6c76d
2024-09-28 18:22:39 +00:00
Nikita.Ashihmin
7283943f42 PY-75725 Packages(fix): simultaneous upgrading of multiple packages isn't working
GitOrigin-RevId: 503a98b90762ba21f1e5a628e9c929ee32eb1a29
2024-09-28 15:35:03 +00:00
Ilia.Kondakov
fe4a6bf3a4 PY-50934 Implement features for ML ordering imports
add new features: info about underscores in path, info about lib location, info about context of original file(extension type, psi parents, size of project),
info about already existing imports from the same library(in this file, in other opened files, in other files in the same directory)

GitOrigin-RevId: ca8206d4d7db6bc79e8f1a78502bf33696a653e9
2024-09-27 10:33:53 +00:00
Ilya.Kazakevich
649570e32a Python NPW: Use Flow instead of StateFlow in API.
`StateFlow` *always* emits current value to any new subscriber, so `first()` could be used instead.

Doc says:
> State flow always has an initial value, replays one most recent value to new subscribers

GitOrigin-RevId: b9b18c4cd28daa9308b68c4221edba7ef17692e2
2024-09-27 03:12:49 +00:00
Egor Eliseev
e4c99d33b7 Use global SDK table while creating Poetry/Pipenv sdks
Updated CustomNewEnvironmentCreator to use global SDK table for retrieval.
Small models.kt refactoring.


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

GitOrigin-RevId: 48854d94e7262a88df87d7628591b68b4582a618
2024-09-26 18:55:55 +00:00
Alexey Kudravtsev
a8861d2917 fix "read action required" exception
GitOrigin-RevId: 1f3fc7fcd7cc977528a9bf49b4e2dacb4333b1aa
2024-09-26 18:19:07 +00:00
Nikita.Lyubimov
8bab85c941 [RIDER] Convert InvertBooleanDelegate to LanguageExtension and make it visible only in supported languages (fix RIDER-117948)
(cherry picked from commit 3a255ec3c42321ec72f4431dea87ae42c1676146)

IJ-CR-145564

GitOrigin-RevId: 13bc1936ceacb3d82585a34c9b0553b13b368259
2024-09-26 15:59:17 +00:00
Andrey Lisin
4843e1d6e4 PY-73432 Introduce checkbox option for enabling debugger server mode
GitOrigin-RevId: 7a9bc66ab59b2a209c15d3313256f2ebf61e2193
2024-09-26 13:47:19 +00:00
Egor Eliseev
ed136fcdd4 [python] Fix Python Console tests
Delete IPythonConsoleTest#testParsing: duplicates PythonConsoleParsingTest#testQuestionEnd. Fails because a virtual file is not marked as IPython.
PythonConsoleTest#testCompletionDoNotEvaluateProperty: rewrite to static.
DebugConsoleTest: delete deprecated python function.


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

GitOrigin-RevId: 3708defece0a957708073b524995c21e7d095224
2024-09-26 13:05:09 +00:00
Andrey Lisin
95e95ad914 PY-21325 Add option to configure debugger port
GitOrigin-RevId: 312da6bbb2aafadc9600c0d5cc36a07052d52886
2024-09-25 20:36:51 +00:00
Daniil Ovchinnikov
afb2f70020 IJPL-453 intellij.platform.testFramework.teamCity dependency
GitOrigin-RevId: 1cf587c535de1f88b52a5d92ea7488c741e71035
2024-09-25 19:42:36 +00:00
Irina Fediaeva
c4cb384bb7 PY-75246: Fix quick nav info for file and directory refs
GitOrigin-RevId: b2a6daaebf0f043f1bce2952637bf86c556e8646
2024-09-25 17:53:14 +00:00