Replace the LocalInspectionTool-based "no interpreter" warning with an
EditorNotificationProvider banner. This extends coverage to pyproject.toml
and README.md files (in addition to .py files) and simplifies the fix
architecture.
Key changes:
- Delete PyInterpreterInspection, replace with PyInterpreterNotificationProvider
- Add PyInterpreterNotificationFileOpenedListener for split-editor timing
- Replace LocalQuickFix with a simpler InterpreterFix interface (no ProblemDescriptor)
- Simplify PyAsyncFileInspectionRunner: use refreshAfterWrite for flicker-free
cache refresh, use EditorNotifications instead of DaemonCodeAnalyzer
- Remove PyInterpreterInspectionSuppressor (no longer needed without inspection)
- Add isPythonModule check for the module
- Move bundle keys from PyPsiBundle to PyBundle with python.sdk.* prefix
- Extract CONFIGURABLE_ID constant in PyActiveSdkModuleConfigurable
IJ-MR-192977
(cherry picked from commit 6b3584d6c6beac53f4b8f0abb9a34e698b4ad03f)
GitOrigin-RevId: 1df48bbfbade2f7f31ffae7b02a0cab2f1f68389
Support a mechanism for recommending a tool installation if we're
confident it should be used for SDK configuration. For now, it only
supports uv (with uv.lock check).
It also fixes PY-87744, since we dropped all usages of PyDetectedSdk in
our SDK configurators.
GitOrigin-RevId: f99a1089025079313db9aae09e3cfc0205e7e37f
- 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
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
PyInterpreterInspection uses SDK configurators to find existing
environments and find the most suitable SDK. This operation takes time
(especially with conda on Windows), and on top it's performed on every
file change, making UI freeze all the time.
This change makes inspection asynchronous by caching the result and
triggerring inspection again to show changes on the UI.
GitOrigin-RevId: 6a64101c5b4e5c36841f0d7c046c5fce1c5fd50b
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
+ 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
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