It correctly takes into account the first argument of `__new__` that is also implicit,
and thus should be excluded when reporting positional-only parameters following
non-positional-only ones.
(cherry picked from commit abf09c6be5e49c21c12264d22bf63a51018fdcd6)
IJ-MR-180323
GitOrigin-RevId: 85fb7ea284a237252e8634344b968981eda56dc3
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.
Follow-up to IJ-MR-178613
GitOrigin-RevId: ed9e1aad89fb24ce70ba910ddd386a1adccd1baf
Before, `context.getType` was called for both sides of the binary expression. However, the type of the parameter itself was not needed, only the type of the other operand was used to check if it's None or not
(cherry picked from commit 3f70eb2d8e96fa27b4004e79650197173a86985e)
IJ-MR-172702
GitOrigin-RevId: 0d8c70aac62f15ae32ba077a009eaebb77c87504
Avoid converting function to property getter when the reference we are resolving sits inside a property(...) call (e.g., property(__getX))
In such context we actually need the bare function, not the property
(cherry picked from commit a0409fde44955dd5407e3dcdb4fde339d6ba779b)
IJ-MR-172702
GitOrigin-RevId: 537436bef686f3f49c940231b815922c5a0a133a
During resolving decorators like `@x.setter`, `x` was checked for overloads.
For that, every function, including the one originally decorated by `@x.setter` was checked for having an `@overload` decorator.
For that, `@x.setter` was resolved again, leading to an infinite recursion.
To fix that, a direct check is added to return early if `setter`, `getter` or `deleter` are converted to known decorators.
(cherry picked from commit 2e9eaccd3146b17734902b6be69ebe7d9e9a8b95)
IJ-MR-172702
GitOrigin-RevId: 77d71e6a19f8b9005395e5c69480580b519fc73b
Use `context.assumeType` to avoid an infinite recursion while processing local variables and getting the type from usages
See tests `PyTypeTest#testAnyIsNone` and `PyTypeTest.testParameterFromUsages` for an example
(cherry picked from commit c68125b556e264d99a0bd5217827e11a666ca2e4)
IJ-MR-172702
GitOrigin-RevId: b0ee153f1164033aa97195f9a2f015c771ce7c44
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.
(cherry picked from commit 8f26c59da8501f8eac78d1280888dd49ffef28d4)
IJ-MR-179295
GitOrigin-RevId: c7adf278a888fc0246351ea399e47784e6788de5
Mark PyWithAncestors.getAncestorTypes return type as @Nullable
(cherry picked from commit fb7cbbebfac371b21456711087f82fbdaf21673c)
IJ-MR-179357
GitOrigin-RevId: f24cca2c4923f4bb06b4f7204f2c56b95047e4cf
- use given clazz's class loader to avoid "is not visible from class loader" check in java.lang.Proxy.ensureVisible()
(cherry picked from commit 5d275b1353383691fe907caa039a15706e9b7a18)
IJ-MR-178968
GitOrigin-RevId: 11d8ea6498393b0101a7c7086d8402b24be2ed5a
Target expression should have either explicit `TypeAlias` annotation or valid type expression in assignment without type annotation (to be considered implicit type alias)
(cherry picked from commit 1059a8df2d221bd068eee706139be20c256df549)
GitOrigin-RevId: 8c952138fbc4124f02f717ce8a1784c1f0dc86b2
+ 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