Commit Graph

6089 Commits

Author SHA1 Message Date
Irina Fediaeva
65ca3c266f PY-56609: Refactoring in quick documentation
Put back forgotten tests

GitOrigin-RevId: 06e000edb6b8327e95d066804d68ad959ba7ba0e
2023-01-23 13:38:58 +00:00
Irina Fediaeva
4cf3747c3b PY-56609: Refactoring in quick documentation
Rename test due to migrating to Python 3

GitOrigin-RevId: d3a90dfe2c8dcdf1bf56b9738d1b729c5063c485
2023-01-23 13:38:48 +00:00
Irina Fediaeva
a143468daa PY-56609: Refactoring in quick documentation
Migrating PyQuickDocTest.py to Python 3

GitOrigin-RevId: 2ad69939a695066d92f7c8c937828f8097110a62
2023-01-23 13:38:46 +00:00
Nikolay Chashnikov
2999a2c383 cleanup: remove redundant '@author' tags from javadoc comments - 24
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: f1b80125c2555d89f32aae4e5290d7771a357abf
2023-01-18 17:02:43 +00:00
Nikolay Chashnikov
4a1b1e2eb2 cleanup: remove redundant '@author' tags from javadoc comments - 19
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: b442e8499110d543d5ec05b9e07f6c0f88b61ecc
2023-01-18 17:02:27 +00:00
Nikolay Chashnikov
4899a5a210 cleanup: remove redundant '@author' tags from javadoc comments - 6
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: 30586ed1915e3b35394ff3ee6251607c64bbabdd
2023-01-18 17:01:44 +00:00
Nikolay Chashnikov
4f51eb1dd2 cleanup: remove redundant '@author' tags from javadoc comments - 3
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: 474de1bafc0651b90f08384cf04094eff9466115
2023-01-18 17:01:34 +00:00
lada.gagina
f3da5e58ae PY-58374 Fix dict keys completion when editing an existing key
GitOrigin-RevId: 41434300f6ea0f776a115a869fb9578a84015471
2023-01-17 19:01:56 +00:00
lada.gagina
f5db62e099 Sync with typeshed @ df905102da05e99e7e7cd6cd0a1e3ddea2eddba2 (excluding the python2 removal)
[PY-57541](https://youtrack.jetbrains.com/issue/PY-57541/Sync-bundled-typeshed-df905102da05e99e7e7cd6cd0a1e3ddea2eddba2)

GitOrigin-RevId: 50eb01e74255002005343caa51bf8eb21c6028a6
2023-01-13 18:45:18 +00:00
lada.gagina
ef2f607f5f PY-42637 Fix quotes for TypedDict keys completion in dict literals
- when there are other keys present in the literal, use quotes from there
- when the literal is empty, use double quotes by default
- when there already are quotes, suggest just the key names

GitOrigin-RevId: 5f37cd25c0e47521e78a01ab84053571369b24a8
2023-01-10 17:39:26 +00:00
Daniil Ovchinnikov
57a55a9c45 deprecate com.intellij.util.io.exists with error
GitOrigin-RevId: e9e931795e2a5bc8ba60408803508d72c84100ea
2023-01-06 20:27:57 +00:00
Elena Shaverdova
2342683398 Improvements for CR-99206 PY-53631 PyCharm 2021.3 indexing files/folders/symlinks in excluded folder
GitOrigin-RevId: f92409ac5906ea7c3178b72090e76594d5ec0972
2022-12-14 01:39:49 +00:00
Mikhail Golubev
5e868d4eba PY-54336 In case of unresolved return type annotation assume that method returns Any
_T_co in itertools.product declaration in Typeshed used to be imported from
_typeshed/__init__.pyi stub and was not resolved as a name starting with
an underscore. Nonetheless, its method __next__ was still recognized as generic
because _T_co used in typing.Iterable.__next__ was used instead thanks to
PyAncestorsTypeProvider. In other words, we inferred a TypeVar as a return
type of a method of a non-generic class. It led to retaining this TypeVar as-is
(not replaced) after substitution and SOE further down the road.

Ideally, the same should be done for other places where type hints can be used,
e.g. if a local variable has an explicit annotation, even an unresolved one,
no other type sources should be examined. Unfortunately, it's not as
straightforward for variables and parameters since their annotations sometimes
don't contain a type, e.g. x: Literal = 5, or x: Final = 5. It means
that we need to distinguish somehow between the cases "incorrect annotation, use Any"
and "this annotation requires further inference for the assigned value", and
our API doesn't allow to express that at the moment.

GitOrigin-RevId: 1bba57bb38718bcab7778049a91d5cbffb5e87c2
2022-12-07 19:04:56 +00:00
Mikhail Golubev
36ff257cd4 PY-54336 Properly protect against recursive substitutions in generic types
The original problem was seemingly fixed by the recent sync of Typeshed
(see 1b80465a7c72f89f48b22d35b69e4da4ea1efd46) where the declaration of _T_co
used in itertools.product.__next__ was moved from from _typeshed/__init__.pyi
to itertools directly.

The SOE was caused by the fact that due to unresolved _T_co in itertools.pyi
we retained _T_co type var in the result of product("bar", "baz") call. Then,
as a value of type list[_T_co] was passed as an argument to
list.__init__(self, __iterable: Iterable[_T]), we formed a mapping
{_T -> _T_co}, but the definition of list[_T] inheriting from Collection[_T_co]
itself added a mapping {_T_co -> _T}, hence we got a cycle.

The right way to handle such cases is introducing scope owners to TypeVars,
as it's being done in PY-53896, so that we can distinguish between _T_co's
coming from different class declarations, i.e. Collection:_T_co and product:_T_co.
Having a recursion check as a safety net is still beneficial, though.

GitOrigin-RevId: 7bebbe14931d44b12bc778f449f854d328169450
2022-12-07 19:04:53 +00:00
Lamberto Basti
2370fcc684 Total rework of the business logic of the PKGS plugin
GitOrigin-RevId: e4cace15934addc48f5a76f293f11e0b2a0d92b0
2022-12-07 15:18:33 +00:00
Andrei.Kuznetsov
cdea2c52ca Restore backward compatibility of FilePropertyPusher: getFileDataKey should return Key
Otherwise, existing plugins will not be binary compatible with the new platform.

GitOrigin-RevId: 7e9ca0b981b37ba3e85115d7c4b96a983ba9b480
2022-11-29 21:18:51 +00:00
Semyon Proshev
473c8243e5 Remove code that does nothing after f630c748
GitOrigin-RevId: f76333cf82a27f1df07b7cc637fe99ea123980bc
2022-11-28 20:38:06 +00:00
Alexey Kudravtsev
b2996cda44 deprecate ContainerUtil.newArrayList(Object) to prefer more immutable List.of()
GitOrigin-RevId: 7aadc5db58512750fbf47563df2d77f9be4c6e83
2022-11-28 19:58:14 +00:00
Gregory.Shrago
60dfc9d563 TestActionEvent cleanup 2
GitOrigin-RevId: 617de5980bcee07a7ad4c213039cc5684dac666e
2022-11-25 04:38:25 +00:00
Elena Shaverdova
21c45f9e88 Revert "Revert "PY-53631 PyCharm 2021.3 indexing files/folders/symlinks in excluded folder""
This reverts commit a6547911f146ecd016a3e6e671ea3a698ce58b2f.

GitOrigin-RevId: 23fff5b8836dec24141492cc6720e0571ff81e52
2022-11-24 21:06:57 +00:00
Tagir Valeev
430b6790da Warnings fixed
GitOrigin-RevId: 223091ab18c0fc1d86a40e375b61711c5bd6c204
2022-11-24 13:08:43 +00:00
Elena Shaverdova
6ba1481632 Revert "PY-53631 PyCharm 2021.3 indexing files/folders/symlinks in excluded folder"
This reverts commit 855d4b91a01e10930d7ea07a39f0a0763fbab25c.

GitOrigin-RevId: a6547911f146ecd016a3e6e671ea3a698ce58b2f
2022-11-23 22:28:22 +00:00
Elena Shaverdova
90cc0114cc Add JDK correctly, see commit a15c4430
GitOrigin-RevId: 336e799173c4f6843ed2df2b704681cf64859575
2022-11-23 12:45:56 +00:00
Elena Shaverdova
342033006d PY-53631 PyCharm 2021.3 indexing files/folders/symlinks in excluded folder
GitOrigin-RevId: dcc3663987520411771a5fd92421d0c797ca6711
2022-11-23 12:45:54 +00:00
andrey.matveev
91b3e6051c PY-16622 Fix Enum instance causes .value to be incorrectly interpretted
GitOrigin-RevId: e181b2d71eff98bb48936a0bcce9075aaba6e0a7
2022-11-23 10:03:19 +00:00
andrey.matveev
5d0d911428 PY-55734 Fix IntEnum value type inference
GitOrigin-RevId: cd84da49568489110c2c402efda33b633a010be1
2022-11-23 10:03:16 +00:00
Mikhail Mazurkevich
5662937ca8 [python] Get rid of adding duplicate SDK
Without this fix `ProjectJdkTable` contains two identical SDKs and it leads to incorrect behaviour later. One is added implicitly via `PySdkExtKt.setPythonSdk` another explicitly in test `ProjectJdkTable.addJdk(com.intellij.openapi.projectRoots.Sdk)` but without check for duplicate. And later in test after SDK remove, `ProjectJdkTable` still contains one link to the disposed SDK and it's incorrect.

GitOrigin-RevId: a15c443007ad3f3106001dc4abadad2989d20073
2022-11-22 18:41:21 +00:00
lada.gagina
293bb95998 Sync with typeshed @ 460537c7f69ea36aa9ad12ca1bfb48ea56239462
Fixes PY-53839, PY-56090, PY-55053, PY-57120, PY-53965, PY-56368, PY-54532

GitOrigin-RevId: 1b80465a7c72f89f48b22d35b69e4da4ea1efd46
2022-11-21 14:46:32 +00:00
Mikhail Golubev
9bb81ec3b0 PY-53047 Exclude known reST and Epydoc tags from Grazie grammar checks
Namely, ignore everything starting with a known tag and until the closing
colon. It should match constructs like ":return:", as well as
":param list[int] x:". Excluding just the tags is not enough,
as the following identifier and colon are still recognized as part of
a grammatically-incorrect sentence.

In other languages, where markup elements in documentation comments have
their own PSI elements, this exclusion is easier. Maybe we should do the
same for reStructuredText directives at some point.

GitOrigin-RevId: 9c50148097d3e27fe79cdc0a9aa90a7946b215ca
2022-11-18 20:00:14 +00:00
andrey.matveev
12283c685e PY-4418 Use property instead of method call
GitOrigin-RevId: f0432a1b1ff44a7c93d8e331a4e8921ecf7d7d1f
2022-11-17 18:09:13 +00:00
andrey.matveev
531c8dbdef PY-36158 Add all star import sources if imported element qname not locally resolved
GitOrigin-RevId: 0f65429042ebde43cbf04ec66abf6f392e71ae67
2022-11-17 16:56:01 +00:00
Ilya.Kazakevich
533b52a0c8 PY-57275: Fix test
GitOrigin-RevId: 1c5574e9affbdc7724b8c939081d932f76cbe9ea
2022-11-16 13:59:10 +00:00
Ilya.Kazakevich
fe64ab1b16 PY-57275: Use legacy conda for local targets by default.
* Set ``use.python.for.local.conda`` (true by default)

* Use ``addCondaPythonToTargetCommandLine``: it either adds ``python`` or ``conda run`` depending on this setting

GitOrigin-RevId: b727382ec3b7a38338e1449bd592add540637626
2022-11-15 22:18:23 +00:00
Tagir Valeev
7476b990c7 Warnings fixed
GitOrigin-RevId: e84185ed443ce7da16b88866f1e9ee6129a4a2be
2022-11-15 15:58:28 +00:00
Ilya.Kazakevich
c7ccd35a26 PY-57391: Filter Conda language levels for new envs
GitOrigin-RevId: a619242c400bba201eb2e096062add9b8529a7ff
2022-11-14 22:44:16 +00:00
andrey.matveev
70d6a4eb79 PY-55360 Use sdk instead of sdkHomePath to allow select interpreter in docker compose
(cherry picked from commit 2ae371ce70be9490ddb14b6981366e06a41ddb5d)

IJ-MR-96284

GitOrigin-RevId: 832cadd71e1a0d47852e44854b2ead217342b7e4
2022-11-14 18:55:08 +00:00
Egor Eliseev
66297780d3 PY-56120 Add tests
GitOrigin-RevId: 12b363fa88b6722f6056cb82f7f8a91cacd3336a
2022-11-14 06:32:11 +00:00
Ilya.Kazakevich
3a0fc5ba5e PY-57146: Fix warning for non-base condas.
See ``TargetedCommandLineBuilder.addEnvVars`` doc for the main issue.
We also add fix to patch path in PythonScripts

GitOrigin-RevId: f42044338f91d5b444c5e1431957272392ab5f1c
2022-11-10 23:02:30 +00:00
lada.gagina
e0b5e68850 PY-55092 Fix generic substitution in TypedDicts
GitOrigin-RevId: ac08e9ad37891830321bd847cbe9101911ac9641
2022-11-10 19:20:00 +00:00
Ilya.Kazakevich
ab43751a51 PY-57146, DS-4124, DS-3992: Fix local conda activation on Windows for newly created SDKs
What was wrong:
For SDK creation we execute python to get python path for homePath (see ``PyAddCondaTools``).

So, we execute python on conda before homePath set.

On each execution we read vars from ``activate.bat`` to workaround conda SSL in path problem and activate terminal (since cmd in terminal still uses old API).

``PySdkUtil`` can't read vars when homePath not set, hence caches empty vars for SDK and both terminal and conda workaround stop working until IDE restart.

We now stopped caching empty vars if homePath is empty.

GitOrigin-RevId: de3e37bbbc5281775e3fca79840089561ceed189
2022-11-08 20:19:13 +00:00
Ilya.Kazakevich
6358b3a523 PY-57184: Store local conda path
We can't store it for random target since target lacks of ID, but for local it is possible

GitOrigin-RevId: e8f68f8e68347e5493daab7ca15f81f1e42eda66
2022-11-08 03:11:58 +00:00
Ilya.Kazakevich
8e079e2a96 DS-4059: Prevent user from choosing anything but Conda as conda executable
* Field validator for Kotlin DSL UI
* Button disabled if conda path doesn't contain "conda"
* File chooser filters wrong files

GitOrigin-RevId: 7c0cbe1270d6ffe12a356a62399a06588e512dff
2022-11-05 14:12:54 +00:00
Alexandr Evstigneev
6ac272826e Inlined few deprecated methods
Continuation of f7c787f2fe3e589bff5cc93c721a6e83b3f4aa32

GitOrigin-RevId: 2c738b6e571af6a1a6eeeb658e8954c767fb671c
2022-11-04 05:27:26 +00:00
Ilya.Kazakevich
251c787c53 PY-56783: Prevent user from creating new conda environment over existing
GitOrigin-RevId: 3fea5660d25091790f9ccd3c4a571624b2eb9b96
2022-11-03 23:43:38 +00:00
andrey.matveev
d0e0488fe6 PY-40797 Fix problem with inline string to f-string
GitOrigin-RevId: dbc2206fa2338e2b6a2552a0ca76cb4064425505
2022-11-03 17:30:23 +00:00
Andrey Lisin
57ec2178e4 PY-56939 Explain why stopping at breakpoint is essential for test
GitOrigin-RevId: 033c8cc73fb62f3a2a17f1ba9428c720a1c8f1bc
2022-11-03 15:37:45 +00:00
Andrey Lisin
84967ef5a8 PY-56939 Add smoke test to check that debugger starts without errors
GitOrigin-RevId: 61a1312e68a06fb696ae9b24c7c35d42d8ad4ec7
2022-11-03 15:37:39 +00:00
Petr Golubev
68f080743c move python formatter extensions to python.psi.impl module
GitOrigin-RevId: 452346cbd12e9c21c636dc8dbcab9a29813bc67b
2022-11-03 14:27:33 +00:00
Ilya.Kazakevich
7de3513159 DS-4056: Allow dashes in conda env names
GitOrigin-RevId: d67273ae767b32d21a9f1ad11393a6fa071492d2
2022-11-03 01:21:57 +00:00
Ilya.Kazakevich
1c0d6c11ed PY-57137: Read env vars for local conda to workaround conda bug.
Conda failed to load OpenSSL dll on Windows. It does so due to bug in ``conda.bat`` machinery that doesn't add required dir to the ``PATH``.

However, when you activate conda (``activate.bat``) it works. As workaround, we revert old behaviour: read ``activate.bat`` and fetch list of env vars (``PATH`` including).  See comment in ``PyCondaEnv``

GitOrigin-RevId: 0238b7308043d8ff73d026f5ce231a993f9d9240
2022-11-03 01:21:54 +00:00