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: 889bdaac6a0a34cfca4d29d6a43eb95824b32fe4
+ 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
- support @dataclass(slots=True)
- add inspection for conflict with explicit __slots__
- add quickfix for new inspection
- add/adjust tests
GitOrigin-RevId: 5ac6efeb6c1e209b641365e2f22bdca74ae6484a
- moved functions to `PyTypeUtil`
- improved naming and documentation
- improved hitbox for unnecessary
- added tests to suites
Merge-request: IJ-MR-174646
Merged-by: Morgan Bartholomew <morgan.bartholomew@jetbrains.com>
GitOrigin-RevId: 4cecc6eb9a22cd8cc4d4019e0ff6f22faebe8cae
- adjust parser to support comma separated list of error classes
- add problem annotation and quick fix for missing parentheses
- add new tests, adjust old tests
GitOrigin-RevId: a1b9bdf252ac874aa7bd1a6881c1784259bb35cc
It also fixed problems with not reporting an error when a union
contained an incompatible class but didn't contain Any
(there was an unnecessary isWeak check) as well
as reporting false positives when a union contained special
members types for which we suppress attribute access warnings,
such as classes inheriting from Any or implicit protocols
(PyStructuralType).
Missing equals/hashCode needed to be added to PyStructuralType,
because otherwise PyUnresolvedReferencesInspectionTest.testUnionContainingUnknownType
started blinking due to unions sometimes containing duplicate structural types
(i.e. in some test runs `Union[{smth}, str]` was inferred and in others --
`Union[{smth}, str, {smth}]`).
GitOrigin-RevId: 63f720844c2892d2baa82be19b573221bd4f5d99
Under the registry flag "python.typing.strict.unions", enabled by default.
"Strict" union is considered a subtype of another type only if *all* its
members are subtypes of this type. Similarly, accessing an attribute on
a union type considered safe only if *all* its members contain this attribute.
It holds even if one of the union members is Any, i.e. "str | Any" is still
incompatible with "int", and it's not safe to access a non-str attribute on
it.
This is how all other type checkers treat union types. Historically, we
use so called "weak unions", where the above rules were relaxed so that
it was enough to have at least one compatible member type. It was
necessary because back then there was no way to declare function overloads,
type narrowing was limited (no pattern matching, no TypeIs/TypeGuard),
so proper strict unions, as in the type theory, would cause too many false
positives.
Co-authored-by: Aleksandr.Govenko <aleksandr.govenko@jetbrains.com>
GitOrigin-RevId: 8a676d810548bf71ac0ff3497e59d8694e03e4db
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
It also caused double highlighting on the frontend as PyKeywordHighlightingAnnotator is currently registered in both frontend and backend.
GitOrigin-RevId: cdf111acfdb8a979613007e12abcf6c7dac9c9dd
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
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
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