Commit Graph

1483 Commits

Author SHA1 Message Date
Egor.Eliseev
2317f2b12d PY-73492 Fix errors with "helpers-pro" dir path
Change the "helpers-pro" path from `python-ce/helpers-pro` to `python/helpers-pro`


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

GitOrigin-RevId: 097aebb0e82024bcee84d7527a39813285e94414
2024-06-26 15:21:35 +00:00
Nikita.Ashihmin
2f85fa81e2 PY-73366 Jupyter: Remove ability to set own language
GitOrigin-RevId: 27cbc3d76b21f139859c33179cb637e91ba8101b
2024-06-22 21:47:44 +00:00
Nikita.Ashihmin
4d5bff8b61 PY-73366 Jupyter: Add ability to use own language of psi elements
GitOrigin-RevId: 57a4df0c69209f58f99762f293b47ce2d535bf3f
2024-06-22 09:20:24 +00:00
Andrey Vokin
3f81ae2ba0 PY-61413 Freeze due to non-cancelable RA in PythonLanguageLevelPusher
Do not iterate over all files in a directory. Because PythonSdkPathCache defined by SDK and SDK can be found by a directory

GitOrigin-RevId: 9575e24b9c38a3203f387e8aaea32ab28507be4c
2024-06-21 20:18:37 +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
Andrey.Matveev
2854de57c0 PY-62301 Not highlight Self in __new__ method
GitOrigin-RevId: 099d4ca6f34b30e757ad030f418c9db827a71abe
2024-06-19 15:03:24 +00:00
Tagir Valeev
440654c48f Pattern variable can be used fixes; other warning fixes
GitOrigin-RevId: 49f37e7f5d748be50ee66fdf66a5c9b98b1b7432
2024-06-18 19:55:23 +00:00
Andrey Vokin
170506beaa PY-73102 Presence of @warnings.deprecated or @typing_extensions.deprecated decorator suppressed errors about incorrect call arguments
GitOrigin-RevId: d1a5a4ce224fe92af9f0df376b63b8cb38ca3990
2024-06-17 22:26:51 +00:00
Andrey Vokin
f2a322c6d9 PY-73107 Usages of @warnings.deprecated inside .pyi stubs are ignored
GitOrigin-RevId: 7682eff8c8ca8ae8241ddee3191add34ab2ac22e
2024-06-17 22:26:51 +00:00
Petr
ee91d6a211 PY-72661 Literal completion inside nested parenthesis
GitOrigin-RevId: 14f18efcbaa520ac36ddd4892b774ed60a01cfdc
2024-06-17 20:36:23 +00:00
Mikhail Mazurkevich
5224cc5e77 [workspace model] Hide entity field EntityChange.Removed and EntityChange.Added
GitOrigin-RevId: 8cf5fda04c6b86c370b40b199f5e0e7faf879a02
2024-06-17 15:09:37 +00:00
Daniil Kalinin
a43fd578d5 PY-54345 Revert changes in PyOperatorReference, return the first metaclass of type which PyCustomType mimics in PyCustomType#getMetaClassType
GitOrigin-RevId: ca58de8f4c98a9e77af45884e55dbe167316aff2
2024-06-13 16:59:19 +00:00
Mikhail Golubev
aff932b7c9 [python] Add methods visitPyKeyValueExpression to PyElementVisitor and PyAstElementVisitor
GitOrigin-RevId: 247a02160e18c93a00b1630e2ed70cea6dcefbbf
2024-06-13 11:59:38 +00:00
Andrey Vokin
673383c3da PY-61651 Deprecation highlighting with PEP 702 @deprecated decorator
GitOrigin-RevId: 426e7001d20849d7029fea55431d3e2cfae3eb11
2024-06-10 15:58:53 +00:00
Petr
3f43255122 PY-73076 Ctrl+Z doesn't work in RemDev
GitOrigin-RevId: e80b54e1a43e9f83be921096a1bc3a0059795cb7
2024-06-05 17:51:13 +00:00
Daniil Kalinin
1cfcce3b7a PY-54356 fix "Callable | None" raises the warning "Cannot find reference '|' in 'Callable'"
Previously, there was no chance to resolve `__or__` member for class references like `Callable`, `Generic` as its type is PyCustomType that always returns `null` from getMetaClassType(). Now in operator references we at least resolve such references in types which PyCustomTypes mimic to

GitOrigin-RevId: ff05ae62e4c1a17026310a3407f40597154bc946
2024-06-03 17:32:16 +00:00
Petr
35ab642bdb [python] Lift typed dict keys higher in completion lookup
GitOrigin-RevId: 82be304d1187fb464eb45ff467e99cf8c41064c1
2024-05-29 19:22:44 +00:00
Mikhail Golubev
d99a86efeb PY-35190 Fix resolving the register method of ABCMeta
The root cause was introduced in PY-23540 (see cb598c94c5).
Namely, abs.ABCMeta was explicitly filtered out from the list of metaclasses in
`PyClassImpl.getMostDerivedClassType` because for some reason in Typeshed stubs for
Python 2 `basestring`, and hence `str`, uses `ABCMeta` as its metaclass,
which is not true at runtime. It caused a metaclass conflict when inheriting `str`
with another user-defined metaclass (`ABCMeta` and a user metaclass didn't extend
each other), so we didn't detect any metaclass in a class as a result.

I've updated Typeshed stubs for Python 2 manually to process ABCMeta normally.
We don't update these stubs anyway, so these changes won't be lost on a future
Typeshed sync.

GitOrigin-RevId: 680e9fa890d00ea63987f3cf73e636e430685f34
2024-05-28 08:41:05 +00:00
Mikhail Golubev
8322bb476d PY-55086 Do not report raising a BaseException instance directly
See https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement.
I decided not to update the inspection description, because BaseException is not
intended to be inherited by user classes.
The check for Exception was removed because Exception itself extends BaseException.

GitOrigin-RevId: 5782c9351aebb524c4d0fc0c9f3307d8db682efb
2024-05-28 01:10:12 +00:00
Mikhail Golubev
46d7223d9f PY-70528 Refactor handling of the *Ts and Unpack[Ts] syntax in type hints
to have better code re-use between PEP 692 and PEP 646 implementations.

GitOrigin-RevId: 39d714fcb14ba1014099fd57325c5185df34ce45
2024-05-28 01:10:09 +00:00
Mikhail Golubev
93ac5fe566 PY-70528 Add support for typing_extensions.TypeVarTuple and Unpack
I've add-hoc updated typing_extensions.pyi in the bundled Typeshed to
recognize Unpack there.

GitOrigin-RevId: 953402e42984712a630c1772cf2f2cd4cbacdccf
2024-05-28 01:10:05 +00:00
Petr
c8509ccc80 [python] Support TypeVarTuple from typing_extensions
GitOrigin-RevId: 02ed108a55d3feed54d95bfb5552f31cdf3e4880
2024-05-24 22:15:34 +00:00
lada.gagina
625373b47a [python] requirements.txt: check entries regardless of dash/underscore in the package name (PY-65403, PY-70173)
Since pip [normalizes](https://github.com/pypa/packaging-problems/issues/230) underscores to dashes, PyCharm should treat them equally for requirements.txt entries

GitOrigin-RevId: 62149b9c64c67936f1405c7bf282a288e8d52764
2024-05-20 15:56:16 +00:00
Nikita.Ashihmin
c35feaee3e PY-72719 Jupyter(fix): no quickfix to install package
GitOrigin-RevId: b29330a381f7c103688a5a5874a182e4a72caaf9
2024-05-17 22:28:00 +00:00
Petr
01d14fab4e PY-40480 Lift literal type completion results higher in a lookup
GitOrigin-RevId: 51fcf9b611250104fdeff04284e908cce1164560
2024-05-16 20:36:19 +00:00
Vladimir Krivosheev
c783d08867 IJPL-149476 fix IAE due to PyFilterLexer protected ctor
GitOrigin-RevId: b65f7f5fc399476f04e036df94190b30bdf4f783
2024-05-15 21:10:39 +00:00
Petr
abfb927619 [python] PyAssignmentStatementImpl.getTargetsToValuesMapping() Unpack nested tuples as specified in javadoc
GitOrigin-RevId: e0d4c13cadfa11d85ba3ddeba17e3c4cdda0a46d
2024-05-15 00:01:20 +00:00
Petr
b9d89b367a [python] PyAssignmentStatementImpl.getTargetsToValuesMapping() Handle nested parenthesis
GitOrigin-RevId: 6431171bee6624e0256d08fd5e1eddfb82132ccb
2024-05-15 00:01:20 +00:00
Petr
c015ff5cbf PY-55044 TypedDict **kwargs typing
GitOrigin-RevId: 5dff382b321ac166ed4b8cf90e431ea719995608
2024-05-14 23:49:38 +00:00
Petr
aefaeaa52a PY-54151 TypedDict completion at callee does not work for methods
GitOrigin-RevId: 5a037490d8c24ccdd354e8396540a21294148a7e
2024-05-14 22:52:52 +00:00
Petr
feb3bdc4c2 PY-52502 Duplicate completion variants when local variable is used as map key
GitOrigin-RevId: 463225922b2f0201b5d1ed2749f4175a77fd543f
2024-05-14 01:09:52 +00:00
Petr
7965dde4a4 PY-56004 Completion for expected literal types in assignments
GitOrigin-RevId: 06cacc62e068d902b174e5208837959cbd92ed88
2024-05-13 14:59:57 +00:00
Tagir Valeev
7085a927d5 [mod-commands] ModCommandExecutor.executeInteractively convenience method
GitOrigin-RevId: ae163c5afe3391aa73e8b0898546de7e74ce2419
2024-05-12 17:34:00 +00:00
Daniil Kalinin
788390047b PY-64326 fixes for intentions affected by reparseable PyStatementList implementation
GitOrigin-RevId: 9a5954767e062dd95d6eab02283c63b1c39fba49
2024-05-07 17:30:41 +00:00
Daniil Kalinin
ba6015d27f PY-64326 implement incremental parsing for PyStatementList PSI elements
These changes make PyStatementList elements (which are function and class bodies, cycle bodies, if-else branches, etc.) lazy-parseable which means they can now be reparsed without reparsing the whole file if changes are happened inside them accepted as safe

The main reason behind these changes is to improve performance

GitOrigin-RevId: 892acbe0c95fde6aec74b7595b0a58f902c426f5
2024-05-07 17:30:41 +00:00
Petr
2bbe723750 PY-42307 PyPackageAliasesProvider.commonImportAliases should be immutable
GitOrigin-RevId: 49d4ca22becf1fc341fbb60febd72bc2583cb8bb
2024-05-07 14:27:33 +00:00
Petr
41730be0d8 PY-42307 Unused field (PyPackageAliasesProvider)
GitOrigin-RevId: ca0873bf22d5d02f13b7bac55f985932be8ccc43
2024-05-07 14:27:33 +00:00
Vladimir Koshelev
8754f98cbe PY-72443 fix module => package mapping for some of the popular ml libs
GitOrigin-RevId: 962d57b87333c8c196dbd52bcfd4b5a41ba7317b
2024-05-06 15:20:45 +00:00
Ilya.Kazakevich
9f06f1a251 PY-71747: Do not fail if remote interpreter has a path with ssh:// prefix.
Some remote interpreters have `sdk#homePath` starting with `ssh://`.

Code all over the monorepo assumes that `homePath` is a local file path and tries to convert it to `Path` throwing the exception effectively.

There is a `isCustomPythonSdkHomePath` which must be used to check string before trying to convert it into `Path`

The current situation (along with "solution") is a legacy from dark ages and will be rewritten to the workspace model soon

GitOrigin-RevId: 9adc02f312667571a65ff63d4e802aa7d6dbb518
2024-05-02 14:20:44 +00:00
Andrey Vokin
60aa7ae2d3 PY-71972 "Go to declaration or Usages" doesn't work for instance fields from the constructor.
TextOffset is used to retrieve target element here: TargetElementUtilBase#getNamedElement.

GitOrigin-RevId: 5c9d721e6870079e4bf86ab7e5c8efb0be5810b0
2024-04-30 16:17:53 +00:00
Petr
11549ca709 PY-42664 fixed dictionary type inference
GitOrigin-RevId: 3fd967d00a6212769001166975167f022288f787
2024-04-26 20:12:18 +00:00
Petr
c58f577ee8 PY-42664 Code deduplication (PyCollectionTypeUtil)
GitOrigin-RevId: cde6db9b023b33fc5955ed16ae465e00bb6a5160
2024-04-26 20:12:18 +00:00
Petr
68c421f3d9 PY-42738 Incomplete handling of single and double quotes for dictionary keys in auto completion
GitOrigin-RevId: ed480e40c4de292d38efbe59656cf3c8eb234435
2024-04-25 23:00:28 +00:00
Mikhail Golubev
fcf665e761 PY-64304 EA-247016 Report illegal usages of "await" expressions even if there is no operand
In other words, in a statement like "await = 42" there are now both a warning about
the missing operand and a warning that an await expression cannot be used as
an assignment target. This behavior is consistent with other expressions where
additional parsing errors are not special-cased.

GitOrigin-RevId: 37a68eacc7ec042435c185f9ddd8bc2eea42b40f
2024-04-24 09:03:57 +00:00
Mikhail Golubev
b9d7fee816 PY-64304 EA-247016 Don't report illegal "await" expressions used as assignment targets during parsing
Instead, parse them as usual and later report in the dedicated AssignTargetAnnotator
and TypeAnnotationTargetAnnotator. This way, a PsiError element appearing in the PSI
tree of a type declaration statement doesn't cause PyAstTypeDeclarationStatement.getTarget
nullability contract violation.

GitOrigin-RevId: a3e90088cfac7938c398d4d293a72dbd127a2cd0
2024-04-24 09:03:53 +00:00
Mikhail Golubev
5f6848fccb PY-65966 Disable partial tensorflow stubs in Typeshed with a registry flag
Otherwise, incomplete stubs break our custom logic for resolving tensorflow
modules re-exported from its _api.v2 subpackage, such as tensorflow.audio,
tensorflow.image, tensorflow.random, etc.

We did the same for Numpy stubs in the past, enabling them back once they
became mature enough.

GitOrigin-RevId: b1e46067406a592761f56b7d296a287e5282b079
2024-04-23 11:03:04 +00:00
Mikhail Golubev
319738dea5 PY-59791 Simplify extracting a wrapped type from sqlalchemy.orm.Mapped
Use PyTypingTypeProvider.getAnnotationValue for that, similarly to already
re-used in other places PyTypingTypeProvider.getReturnTypeAnnotation.

Also, I've better separated handling of attributes explicitly annotated with Mapped
and just initialized with a mapped_column call. It will help to remove special
casing for Mapped once generic descriptors are fully supported in type inference
(PY-26184).

GitOrigin-RevId: eaeb66abd26b851507970b112360631704b41db3
2024-04-18 22:59:27 +00:00
Petr
e01b0b6beb PY-40480 Completion for argument passed to parameter hinted as Literal
GitOrigin-RevId: 462b03dc35eef70bc873b568cae239d40f1d4974
2024-04-18 20:55:14 +00:00
Mikhail Pyltsin
2152c276dc [python] Pattern variable can be used mass cleanup
GitOrigin-RevId: 04229dfd0912fbc846d4b1d5e3726ef6c9c005c6
2024-04-18 14:03:55 +00:00
Piotr Tomiak
3a14f22bc7 WEB-64707 Flaky test com.intellij.tests.BootstrapTests: org.angular2.codeInsight.Angular2HighlightingTest.testTrUnderTemplate
GitOrigin-RevId: a46fed4f6d7e64a89e44cca76bd09c6c117b0abe
2024-04-17 16:21:14 +00:00