51 Commits
Author SHA1 Message Date
Morgan Bartholomewandintellij-monorepo-bot cbe872c85a PY-87998 PyStringConversionWithoutDunderMethodInspection: initial
(cherry picked from commit 359b9a41515da9a841aad787695dee4ed14a12f5)

GitOrigin-RevId: 76a2706e3175e2cd8768b2c7882c3506120a82cb
2026-03-24 04:40:40 +00:00
Morgan Bartholomewandintellij-monorepo-bot d3a3be4cd7 PY-78235 PyAnyType: option to enable
(cherry picked from commit 9774a8d25a879a47ffe2200cc8a68eeca138274e)

GitOrigin-RevId: 6d04596d71db1589225f7263615aafdeeebcc425
2026-03-22 07:40:26 +00:00
Marcus Mewsandintellij-monorepo-bot bb3287b757 PY-76914 Conformance test failure: generics_variance.py
GitOrigin-RevId: a8685c92130b4554072e7b6b482b418c443f2d24
2026-02-16 21:55:31 +00:00
Morgan Bartholomewandintellij-monorepo-bot 8870cfef3f PY-87568 python: add inspection for coroutine in boolean context
GitOrigin-RevId: a4225a2a8f2959947486a0bf927ff8ac388c5ccb
2026-02-16 13:18:27 +00:00
Vladimir.Koshelevandintellij-monorepo-bot 8762304f24 PY-87020 [python]: use PSI resolution for framework detection
GitOrigin-RevId: c85f2ac367c38f70ebc5d6cfcf79d94517819d0a
2026-01-30 21:49:04 +00:00
evgeny.bovykinandintellij-monorepo-bot d7b180e15d PY-86219 Use weak keys for TypeEvalContext caches by default
Space-RevId: 5bd8593af2f394e5dffaf8d120aad81c1735ed22

GitOrigin-RevId: e61a25688688e216eeddfd0e2212a6a9796cf2f7
2026-01-22 15:36:41 +00:00
Morgan Bartholomewandintellij-monorepo-bot bc0940e05d PY-84033 type engine: callable representation parsing
GitOrigin-RevId: c2926c5d507c2380af394593785297d0a5ddad18
2026-01-14 17:37:57 +00:00
Andrei.Kuznetsovandintellij-monorepo-bot 89314060c4 IJPL-227045 IJ-MR-187307 add "open=true" to services that have overrides
GitOrigin-RevId: f9795dcc08ef0f29ba20443e13a6ead6eade6d98
2026-01-12 13:56:43 +00:00
Aleksandr.Govenkoandintellij-monorepo-bot 1c34e08d66 PY-86123 Add inlay hints for positional patterns in a match/case statement
GitOrigin-RevId: bba519b0ed7b2529f719ae1aaaf23e893761c90e
2025-12-22 22:36:14 +00:00
Aleksandr.Govenkoandintellij-monorepo-bot 02990fbff8 PY-49165 Pattern Matching quick fix to add __match_args__
- Added PyPatternInspection class with logic to highlight and fix issues in pattern matching
- Modified PyAstAsPattern.getTarget() to return nullable value
- Added quick fix for PyAsPattern to simplify patterns
- Added quick fix for PyClass to add `__match_args__` attribute based on `__init__` signature
- Added PyRemoveElementFix quick fix to clean invalid list elements
- Added validation in PyPatternInspection to detect excessive positional patterns
- Added conflict detection between positional and named patterns in PyPatternInspection

GitOrigin-RevId: 64a1693aae2d243b83c46883a5d8476e727562a8
2025-12-22 22:36:13 +00:00
Artem Ivanovandintellij-monorepo-bot 2ba79a9f54 PY-84606 Add inspection for unhashable dict keys and set elements
GitOrigin-RevId: 46ee338cc984b4278bbec19fb47ed7185764e3fa
2025-12-09 22:14:08 +00:00
evgeny.bovykinandintellij-monorepo-bot 6a772de5d5 PY-85638 PY-85893 Use soft-key soft-value map for TypeEvalContext caches
This prevents the caches from blowing up in size when analyzing a lot of files in a row

The most obvious example is running `Analyze code` on the whole project. Previously, all PSI elements from all files would pollute the cache, potentially consuming multiple Gb of memory. See PyDjangoSourcesPerformanceTest as an example. It used to require 16 Gb of heap, and it would still sometimes fail with OOM. Now, it runs smoothly with 2Gb of heap

GitOrigin-RevId: f9854f8abdd7086414df8f610b0f2d611ca0d455
2025-12-09 17:41:26 +00:00
Nikita Paniukhinandintellij-monorepo-bot 788e8300e4 [python] PY-85601 Add "invalid escape sequence" inspection
GitOrigin-RevId: d750f06efc5e42678073de084ecb2976acedd4b9
2025-12-02 21:55:58 +00:00
Mikhail Golubevandintellij-monorepo-bot 7d44617dcd PY-85270 [python] Merge PyModulePackageCompletionContributor into PyClassNameCompletionContributor
Remove the now unused base class PyImportableNameCompletionContributor.

GitOrigin-RevId: 1887fb5bf35bfbc7cdd82bc31e39b0ed17e3ff35
2025-11-11 17:27:35 +00:00
evgeny.bovykinandintellij-monorepo-bot bcf0ff8249 PY-63802 Implement PyChangeLocalityDetector to fix disappearing highlighting when changing whitespace at the top level
By default, when only changing whitespace at the top level, DefaultChangeLocalityDetector would trigger and say that only the changed whitespace should be rehighlighted. However, highlighting for a whole file would still be dropped. After that, PyUnusedLocalInspection would not be triggered for any function in that file, meaning it would not re-highlight them, leading to an inspection warning disappearing.

Now, PyChangeLocalityDetector triggers when changing a whitespace on a top level and triggers re-highlighting of the whole file

Performance consideration: re-highlighting the whole file might be expensive (that's why ChangeLocalityDetector was introduced in the first place). However, no other ChangeLocalityDetector is implemented for Python, so most of the time the whole file is re-highlighted anyways. Re-highlighting the whole file in a new niche case of changing whitespace at the end of the file shouldn't lead to any significant performance impact.

GitOrigin-RevId: 8f26c59da8501f8eac78d1280888dd49ffef28d4
2025-10-28 19:14:41 +00:00
Morgan Bartholomewandintellij-monorepo-bot c2a3f6516e [python] PY-83733 ruff support
GitOrigin-RevId: df443269c3a29cfe9b5f3b67663a1f998396e738
2025-10-15 03:19:48 +00:00
Morgan Bartholomewandintellij-monorepo-bot 4f08c28e9d [python] python-lsp-core
GitOrigin-RevId: e07d457d959a1b589861180c1be06b995218aa2c
2025-10-15 03:19:47 +00:00
evgeny.bovykinandintellij-monorepo-bot 52ec309c76 Introduce python.use.better.control.flow.type.inference again
GitOrigin-RevId: a96eb77a54bf0df442ab9a2044f5bcc517007084
2025-10-15 00:30:08 +00:00
Vitaly Legchilkinandintellij-monorepo-bot 84934e9e9e [python] (IJPL-205889) (BAZEL-2462) don't call getOrCreateAdditionalData for non-python sdks
+ add requirePythonSdk() verification for the Sdk extension functions, these methods are not designed to be called for non-python sdks and now will throw IllegalArgumentException.

also corrects dependency tree:
+ move PythonSdkUtil to the python.sdk module, remove dependency on psi.impl
+ create PySkeletonUtil for skeleton utils and leave it in the psi.impl

[python] (IJPL-205889) (BAZEL-2462) don't call getOrCreateAdditionalData for non-python sdks

+ add requirePythonSdk() verification for the Sdk extension functions, these methods are not designed to be called for non-python sdks and now will throw IllegalArgumentException

also corrects dependency tree:
+ move PythonSdkUtil to the python.sdk module, remove dependency on psi.impl
+ create PySkeletonUtil for skeleton utils and leave it in the psi.impl

GitOrigin-RevId: 20d958c5e15cc4e05545b2e61b126b5e015696ed
2025-10-10 18:17:28 +00:00
Nikolay Chashnikovandintellij-monorepo-bot 3a8344fcad [plugin model] use 'public' visibility for content modules which classes are used from external plugins (IJPL-207059)
153 modules which contain classes used from external plugins from the Marketplace are marked as public. This is needed to ensure that it'll be possible to use that API after converting code from these external plugins to content modules.

GitOrigin-RevId: dc48e8970041fddd3bf50d280711e95ce9e9ad9b
2025-10-08 18:39:06 +00:00
Vladimir.Koshelevandintellij-monorepo-bot ba393efaa7 [python] PY-84398 get rid of embedded loading rules in PythonCore plugin, fix related issues
GitOrigin-RevId: 54f4bb333e0ca06a002a86c75f0bbc474863253e
2025-09-26 15:15:29 +00:00
Marcus Mewsandintellij-monorepo-bot 3914253777 PY-76811 Conformance test failure: dataclasses_slots.py
- support @dataclass(slots=True)
- add inspection for conflict with explicit __slots__
- add quickfix for new inspection
- add/adjust tests

GitOrigin-RevId: 5ac6efeb6c1e209b641365e2f22bdca74ae6484a
2025-09-18 08:08:12 +00:00
Morgan Bartholomewandintellij-monorepo-bot 6072cf8ea5 [python] PY-80252 set correct default highlighting for PyUnnecessaryCast
Merge-request: IJ-MR-173805
Merged-by: Morgan Bartholomew <morgan.bartholomew@jetbrains.com>

GitOrigin-RevId: 2e745411d0c9c477172bf13670b0e073c206d9ae
2025-08-30 04:24:49 +00:00
Morgan Bartholomewandintellij-monorepo-bot c669178c4a [python] PY-83710 PyUnreachableCodeInspection respect user highlighting
Merge-request: IJ-MR-173949
Merged-by: Morgan Bartholomew <morgan.bartholomew@jetbrains.com>

GitOrigin-RevId: ef0241888e12f4930e99b0d5e7c5461ee976e7ab
2025-08-30 03:06:09 +00:00
Morgan Bartholomewandintellij-monorepo-bot 51615780f9 [python] PY-79178/PY-80252 report invalid and unrequired casts
Merge-request: IJ-MR-171620
Merged-by: Morgan Bartholomew <morgan.bartholomew@jetbrains.com>

GitOrigin-RevId: d9b13a99bad56a112f04febfc939823397b55ddd
2025-08-26 01:51:36 +00:00
Aleksandr.Govenkoandintellij-monorepo-bot 8dbb1d0361 [python] Disable strict narrowing, add registry flag to enable it
GitOrigin-RevId: ba403db011803b4aef1ea2b1582374559b70c32a
2025-08-20 14:23:21 +00:00
Petrandintellij-monorepo-bot dd58eaacfc [python] Rm obsolete registry key python.use.better.control.flow.type.inference
GitOrigin-RevId: 47ca59e692de12376ca17604b8b9ab2439882a45
2025-08-19 17:37:04 +00:00
evgeny.bovykinandintellij-monorepo-bot 24079c336d PY-76851 Introduce PyTypeAliasRedeclarationInspection
Similar to PyRedeclarationInspection but specifically for type aliases.
The difference is that for type aliases, we should report them as redelclarations even if they were used before

GitOrigin-RevId: 735c7be53bf7625cf0dccb83d8a3157665f65a96
2025-07-28 15:56:48 +00:00
Mikhail Golubevandintellij-monorepo-bot fd4360b032 PY-75831 tests for split cache(resolve/type) into library and user part
(cherry picked from commit ca5f003693960b25d78bda050b55fe39900be5a7)

IJ-MR-169158

GitOrigin-RevId: 759cb38f76124b5b0709757e8f73ddffbf4a8248
2025-07-28 08:06:50 +00:00
Andrey Vokinandintellij-monorepo-bot 31991b70bd PY-75831 Split cache(resolve/type) into library and user part
(cherry picked from commit 94456d3a1f0be2e747641b74ce8246857b1a3f77)

IJ-MR-169158

GitOrigin-RevId: 4cdf0b90f601ca37b0f11b4392dbcfcf856472c6
2025-07-28 08:06:50 +00:00
Petrandintellij-monorepo-bot 6c3b0171c2 PY-71549 Rename various annotator classes
GitOrigin-RevId: f6ff60d69a708c4a540d69c0f69246afb9815c53
2025-07-16 04:51:32 +00:00
Petrandintellij-monorepo-bot 2e6c983cb2 PY-71549 Convert some syntax-related annotators to visitors and add them to PySyntaxAnnotator
GitOrigin-RevId: 46f4a0ccd8c2e7ef45ce5fa37ec5c48376924587
2025-07-16 04:51:32 +00:00
Petrandintellij-monorepo-bot 02caa4ea03 PY-71549 Rename few annotators
GitOrigin-RevId: 8efc73022d49f23ececc9e4c1c2671c2aabdf327
2025-07-15 11:17:13 +00:00
Petrandintellij-monorepo-bot e4affd421f PY-71549 Extract visitors that rely on resolve from PyAnnotatingVisitor
GitOrigin-RevId: 302a8709562725556aab1ccf5b89759c82acc952
2025-07-15 11:17:13 +00:00
Petrandintellij-monorepo-bot 065fb1cfd4 PY-71549 Rename files (added Py prefix to annotator classes)
GitOrigin-RevId: e854d37609e0dc82191fabc587014947c1f742aa
2025-07-15 11:17:13 +00:00
Petrandintellij-monorepo-bot a51b604bd4 PY-71549 Eliminate global shared state inside annotators
Before, when entering an `annotate` method, a reference to `AnnotationHolder` was stored in the annotator field. And this required synchronization. Now this reference is stored into a temporary PyElementVisitor object actually used to perform highlighting.

Also, register all python annotators using a regular 'annotator' EP. There is no point in using 'Pythonid.pyAnnotator'.

GitOrigin-RevId: ad1df8ce743bc62d3f43e6bf9b1a8ea370ff7de7
2025-07-15 11:17:12 +00:00
Petrandintellij-monorepo-bot 6db8559cd4 PY-71549 Move HighlightingAnnotator, PyAnnotatingVisitor to python.psi.impl
GitOrigin-RevId: 049a21f31101e4c90ebcb1f335825d759ae50663
2025-07-15 11:17:12 +00:00
Andrey Vokinandintellij-monorepo-bot 95529a9325 PY-79510 remove unused index
GitOrigin-RevId: 8f7e5a8db920d9fa68fc1cbc840c97b68668b728
2025-07-04 13:49:25 +00:00
Petrandintellij-monorepo-bot fa98ce5640 PY-81471 Sync PyCodeStyleSettings
GitOrigin-RevId: dd0263865288cc86dc2df0912edfd15ea2fbe3df
2025-06-30 15:46:23 +00:00
Andrey Vokinandintellij-monorepo-bot 8b387672f2 PY-79510 PyCharm: Code entry points for AI playground
Add an index to the names imported from Python. This will allow you to check if the project has AI libraries in its dependencies.

GitOrigin-RevId: d16f3163a602194ef0f3254402dd4061ff8d2f7f
2025-06-23 15:07:44 +00:00
Marcus Mewsandintellij-monorepo-bot cb63214bc9 marcus.mews/PY-55691
PY-55691: `Expected type 'Type[AttrsInstance]'` warning passing `attrs` class to `attrs.fields()`

- add member __attrs_attrs__ to classes decorated with attrs.define or similar

Merge-request: IJ-MR-165647
Merged-by: Marcus Mews <marcus.mews@jetbrains.com>

GitOrigin-RevId: 979f894e595d903c55f33c8bd4c5c3d06cb2fe6d
2025-06-18 21:08:01 +00:00
Andrey Vokinandintellij-monorepo-bot dc83319152 PY-81269 Extremely High RAM Usage
GitOrigin-RevId: bb534d62931c176d2395e2cceb0afabc57464669
2025-06-18 13:17:14 +00:00
Petrandintellij-monorepo-bot 31c71642fd PY-81471 Move PyLineWrapPositionStrategy to python.syntax.core
GitOrigin-RevId: 998a62f09ee1e2fed512c5ae8c8cfed8808c947f
2025-06-13 20:21:12 +00:00
Petrandintellij-monorepo-bot e7a8716848 PY-81471 Move PythonCommenter to python.syntax.core
GitOrigin-RevId: a4d6c426f104f67c0bf95b15b321c101590c5142
2025-06-13 20:21:12 +00:00
Ilya.Kazakevichandintellij-monorepo-bot 80f248d842 Python: Move helpers locator out of PSI module
GitOrigin-RevId: 55fb4b41c56fdd41b6d9523cd7a148c002ffb8be
2025-06-07 21:59:42 +00:00
Mikhail Golubevandintellij-monorepo-bot f43edeeeb6 PY-80971 Remove now obsolete NumpyModuleMembersProvider
We've long enabled numpy's own pyi stubs by default.
Now, without always available numpy stubs in python-skeletons this extension
causes an SOE when there is a module called numpy
(see `SemanticPyUnresolvedReferencesTest.test unresolved import from well-known installed import are critical`).

GitOrigin-RevId: 3cb4ff5ca3404cb4f20dd584da5928c78b73ea91
2025-06-04 18:33:47 +00:00
Mikhail Golubevandintellij-monorepo-bot c48402b4cb PY-80971 Drop the legacy python-skeletons stubs
GitOrigin-RevId: bdd71af6a628d1b9fc03680a33088cc26857b2d0
2025-06-04 18:33:47 +00:00
Andrey Vokinandintellij-monorepo-bot 058c8ad641 PY-62670 Invalid "await outside async function" in Jupyter notebooks
GitOrigin-RevId: 26681302f28da968e0525a908d5b31f7451a9627
2025-05-22 07:10:41 +00:00
Aleksandr.Govenkoandintellij-monorepo-bot 2894089e5a PY-54559 PY-80076 Display inlays hints with inferred types for reveal_type and function return types
Merge-request: IJ-MR-157270
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

GitOrigin-RevId: 1a504fb29b059243ee598672f6f666dbed367b34
2025-05-16 17:47:34 +00:00
Mikhail Golubevandintellij-monorepo-bot f41aae4760 PY-80844 Add a new intention for converting between f-strings and t-strings
GitOrigin-RevId: be3ab4d72de05a92c986af31ac8e40309d9754b1
2025-05-02 12:08:57 +00:00