Revert the revert of test changes that are not directly related to strict unions.
(cherry picked from commit 8a76bd91e040ad97e8ed680161f28370c84920f8)
IJ-MR-184619
GitOrigin-RevId: 4c293de3ecc3c8cb16869532fccc639e8c5a17ae
Namely, `generics_basic.py` in the conformance test suite and
Py3TypeCheckerInspectionTest.testTypeVarWidening.
Revert 07803c6243370d55df0d870e2e32b38170c1fb49
(cherry picked from commit 9c334ef32597be1d1e8fbc3251ac267be46555c8)
IJ-MR-184619
GitOrigin-RevId: 4b2440c973d9c7a7a42590665bd473c4e7a4c9cf
`UnsafeUnion[int | str]` is considered a subtype of `str`, so the cast is redundant.
(cherry picked from commit 550a9d55715564492169175c5e20cfbf1ade4b20)
IJ-MR-184619
GitOrigin-RevId: 854131d04308bd97b12ef06cc10a4aa89238c9ef
`testBreakInFinallyBlock` and `testReturnInFinallyBlock`
were testing vs. latest language level, so apart from
the compatibility warning (for which these tests are
intended) - a corresponding syntax error was captured
I made these tests to use a specific language level
so they only verify the correctness of the compatibility
inspection and introduced four tests in `PythonHighlightingTest`
to capture the syntax error
(cherry picked from commit 254570dc4d5022176590377eaf8ea6a08917937a)
IJ-MR-182362
GitOrigin-RevId: fb9c92923820b370672451c5753ee24bdd5a4570
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
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
Our tool detection approach varies a lot. We have different logic for
uv, poetry and other tools. Also, uv detection is not suspendable and
doesn't have any explicit thread requirements, even though it performs
I/O operations.
This change makes such detection unified and suspendable (where
possible) and moves it to BGT.
GitOrigin-RevId: 18e9c4cc085c8d373c82ad2874033b53711f09c6
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
The main idea is to decouple tool implementation from low-level platform APIs: Open project processor, workspace model e.t.c.
Implementing `spi.Tool` should be enough to introduce new tool.
GitOrigin-RevId: 1177b57fc0eee1ca2c88cac5b20618a6170bf521