Check YieldType of yield expressions in PyTypeCheckerInspection
Check that (Async)Generator is used in (async) function
Check that in 'yield from' sync Generator is used
Convert PyMakeFunctionReturnTypeQuickFix into PsiUpdateModCommandAction
Infer Generator type for lambdas
When getting function type from annotation, do not convert Generator to AsyncGenerator
Introduce GeneratorTypeDescriptor to simplify working with generator annotations
Merge-request: IJ-MR-146521
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>
(cherry picked from commit b3b8182168c5224f0e03f54d443171ccf6ca7b89)
IJ-MR-146521
GitOrigin-RevId: a95670d7e2787015bcf162637ea6d7bfb47a312a
Updated PyFunction to account for implicit 'return None' statements when inferring return statement types.
It affected return type inference of PyFunction.
Fixed a failing test related to formatted strings.
Added a quick fix to make all return statements explicit.
Updated the CFG to include PyPassStatements, enabling detection of exit points in empty functions.
Simplified PyMakeFunctionReturnTypeQuickFix to independently infer function types and handle required imports. Currently, it does not support specifying custom suggested types.
Merge-request: IJ-MR-148719
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>
(cherry picked from commit 9f58961f9eb70e4f9dbba7359f5aafdfd392b7e2)
IJ-MR-148719
GitOrigin-RevId: 68ef5c4a1cc0fcaffd750cc0713250a106136643
GrazieInspection can run in dumb mode after implementation of IJPL-155874.
But unfortunately, one of its filters (CommentProblemFilter) needs indexes.
So in some situations IDE gets stuck.
The easy solution is just to avoid checks requiring indexes.
A better solution would be to detect todo comments without indexes IDEA-364846.
(cherry picked from commit bc8962287f61eade48df703b7fa25dbd78fb83aa)
IJ-CR-151765
GitOrigin-RevId: 41df36e2ee169afedd2667c923afb36f932e6685
__anext__ method is required to return Awaitable. When getting iterated type, unwrap that awaitable
Merge-request: IJ-MR-150432
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>
(cherry picked from commit 97a070ead70c0ec0f2da08000517c592c5805965)
IJ-MR-150432
GitOrigin-RevId: 21dc20b164e6095e56707ea50bc93bf67564e88e
If there is an overload not followed by an implementation, which is
already an error, always resolve to the first overload, regardless
of whether it's a .py file, or a .pyi stub. It allows us to eliminate
the special RatedResolveResult#RATE_LIFTED_PY_FILE_OVERLOAD rate in .py
files, because we no longer need to duplicate the last, closest reachable
overload (normally an implementation should be reachable) with a higher
priority, and then filter it out during overload resolution.
Meanwhile, this filtering out didn't work right before
because some type inference logic, e.g., PyCallExpressionHelper.getCalleeType
used in PyReferenceExpressionImpl.getCallableType bypassed it. It should have
been done at the level of
PyCallExpressionHelper.forEveryScopeTakeOverloadsOtherwiseImplementations.
(cherry picked from commit 99a624ab85957d7a2d3c2c0ced596e472f9d615b)
IJ-MR-148398
GitOrigin-RevId: c2cdfe8c8b046118f4e6f7269dbf7848dd746e08
In r1359167 Google introduced a breaking change: the type of the `Debugger.scriptParsed.debugSymbol` field was changed from `Debugger.DebugSymbols` to `array[Debugger.DebugSymbols]`.
To provide backward compatibility with old browsers, this fix introduces a new reader method `readObjectArrayOrSingleObject` which used if some object property marked with `JsonArray` annotation.
(cherry picked from commit 7847455a7c59cf7c7af3de9b991f2b6ca51928e7)
IJ-CR-150473
GitOrigin-RevId: ae6d2a42490bdcbf867d2727ce8207695d6ee3c5
Previously, we mistakenly tried to resolve qualified names listed in the
`field_specifiers` argument of @dataclass_transform in the same scope
where the dataclass itself is defined, not where the actual decorator
application is located.
Thus, if in the file where the dataclass is defined, a field specifier
was imported differently than where @dataclass_transform was applied, we
couldn't recognize a field specifier call in the RHS of an assignment as such
and took it for an ordinary field default value.
In particular, this is what happened with pydantic dataclasses.
`pydantic.fields.Field` is usually imported as just `pydantic.Field` where
user dataclasses are defined, but imported with an alias and set in the
`field_specifiers` argument as `PydanticModelField` in
`pydantic._internal._model_construction` where `ModelMetaclass` is defined.
It was accidentally broken in f15a07836e7aeac7c46b489b4742e8248a0e6ef4 to
support decorating class methods with dataclass_transform
(see testData/inspections/PyDataclassInspection/DataclassTransformFieldsOrder/decorator.py).
Until PyResolveUtil.resolveQualifiedNameInScope automatically traverses through
containing scopes looking for a name, the file containing decorator application
seems like a safe trade-off for the scope, because field specifiers are normally
defined or imported somewhere at the top level.
(cherry picked from commit de9afeb0831a52f058453fe678de229d41c26a4d)
IJ-CR-151380
GitOrigin-RevId: b6576ec7b72ea1e19e93b6190372a5168003c396
It is better to be more explicit there, both for the sake of readability,
and to ensure safe evolution of the implementation.
Follow-up: IJ-CR-151167 IJPL-173167: RegionUrlMapper: Add async `tryMapUrl()`, migrate most of the usages
(cherry picked from commit fbeba1c512b23975f8676b2def05c6c863f2c835)
IJ-CR-151167
GitOrigin-RevId: e246a05f9efa16ed2b45120645947d62962b2605
Expose a public method `loadMapping()` that allows for proper error propagation.
(cherry picked from commit a0a6f6492773d5f4384ded84a6d0309c017f5fe6)
IJ-CR-151167
GitOrigin-RevId: c9f6a84c74a261369ce585fa14e6a5b156e12842
Every Actor subclass that exists as far as I could tell
now has a DTO representation and a fragment representation.
Sure, there's a lot of common classes, we can reuse actorInfo
in some cases, but I somewhat prefer having the specific fragment
to reference at the DTO class.
Just so that debugging these types of issues is easier later.
actor.graphql now directly represents the 5 possible instantiations of Actor.
(cherry picked from commit 6392ac4ce579ce48682d8cc288d2edfe5480da86)
IJ-CR-151664
(cherry picked from commit bd235370481269453094021d2e03ed91bb48903b)
IJ-CR-151664
GitOrigin-RevId: a6cc560b78552c1ca9003975c0b9fb03fd68b69d
For the moment, only the information about the .vimrc configuration file is collected.
(cherry picked from commit a0f467ff132dc51dafbff746529375c82486fdf6)
IJ-MR-151660
GitOrigin-RevId: 7f5c47a6189bd40413936fb1c64493b9347efc78
Before this change, calls of `File.list` with a path `\\wsl.localhost\debian\tmp` led to an error if the distribution name is `Debian`.
(cherry picked from commit d4e4458349c4501f4a847599428f47d7543ba2ee)
IJ-CR-151160
GitOrigin-RevId: 8648915b0d6b73cdbf3b9172e959c0768087252f
Some plugins still call `getComponent` directly only to get exception.
We make it return `myComponent` until plugins migrate to a new API
(cherry picked from commit d5d4a4a526e236fe285b847992d677f3a92cc4b8)
IJ-CR-151522
GitOrigin-RevId: 6fe5d4bf5a87ef7320e473afd8af9942f2eb151d
Fixes IDEA-362013 Stream.of should not be highlighted because it's not a preview feature
(cherry picked from commit 0818188d2e5ae25916c0433dfe976c808eebf869)
IJ-CR-151174
GitOrigin-RevId: c81154ec031a4da1ef432831628fe93537ce599b