Remove ChainIterable usages from quick documentation and replace with HtmlChunk/HtmlBuilder.
I18ize some fragments.
GitOrigin-RevId: c9b1197efcb17de92361426759a7840ee1be8e4b
- when there are other keys present in the literal, use quotes from there
- when the literal is empty, use double quotes by default
- when there already are quotes, suggest just the key names
GitOrigin-RevId: 5f37cd25c0e47521e78a01ab84053571369b24a8
_T_co in itertools.product declaration in Typeshed used to be imported from
_typeshed/__init__.pyi stub and was not resolved as a name starting with
an underscore. Nonetheless, its method __next__ was still recognized as generic
because _T_co used in typing.Iterable.__next__ was used instead thanks to
PyAncestorsTypeProvider. In other words, we inferred a TypeVar as a return
type of a method of a non-generic class. It led to retaining this TypeVar as-is
(not replaced) after substitution and SOE further down the road.
Ideally, the same should be done for other places where type hints can be used,
e.g. if a local variable has an explicit annotation, even an unresolved one,
no other type sources should be examined. Unfortunately, it's not as
straightforward for variables and parameters since their annotations sometimes
don't contain a type, e.g. x: Literal = 5, or x: Final = 5. It means
that we need to distinguish somehow between the cases "incorrect annotation, use Any"
and "this annotation requires further inference for the assigned value", and
our API doesn't allow to express that at the moment.
GitOrigin-RevId: 1bba57bb38718bcab7778049a91d5cbffb5e87c2
Namely, ignore everything starting with a known tag and until the closing
colon. It should match constructs like ":return:", as well as
":param list[int] x:". Excluding just the tags is not enough,
as the following identifier and colon are still recognized as part of
a grammatically-incorrect sentence.
In other languages, where markup elements in documentation comments have
their own PSI elements, this exclusion is easier. Maybe we should do the
same for reStructuredText directives at some point.
GitOrigin-RevId: 9c50148097d3e27fe79cdc0a9aa90a7946b215ca
Fix tests according to the changes
Merge-request: IJ-MR-98042
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>
GitOrigin-RevId: fb28eb2b435eb71430beaa4c243644daf04e37a6
Control flow now abrupts on `exit()` and `pytest.fail()` calls
Control flow now abrupts only if class which contains `self.fail()` call contains case-insensitive "test" word in the name
Merge-request: IJ-MR-96165
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>
GitOrigin-RevId: ea173fdb72a10a373cd95f266ea7589e36545f30
Fix pycodestyle-violating alignment in multiline binary statements in return and yield expressions
Fix pycodestyle-violating alignment in multiline tuple expressions in return, yield and assignment expressions
Tests for it
Merge-request: IJ-MR-35686
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>
GitOrigin-RevId: 989b4f4aeb61b43d3215a0ad74f7a9d9685464b8
PY-33341: Now we render the “Attributes” section in the class documentation, it also allows to describe inherited attributes. (Previously we didn’t render it at all)
PY-56416: In the attribute documentation popup we are able to render attribute description from class docstring. (Previously we took documentation only explicitly from attribute one-line docstring)
PY-33341: We render the “Parameters” section in the class documentation for init parameters, described in the class docstring. (Previously user couldn't use class docstring to describe init parameters)
PY-28900: For the init parameter documentation we take the description from the class docstring if init doesn't have its own docstring. (Previously we took parameter description only from init docstring)
GitOrigin-RevId: d67bf49c72cf7a3634805a6e310c943f1ea848d1
Now during resolve if there is no class/instance attribute with appropriate name explicitly in the class, we will try to find it in the parent classes and resolve there.
GitOrigin-RevId: 52ab5f0ad63cba187457ba3db6107997ede33dee
Now when parse docstring we take into account the block type. For OPTIONAL_TYPE sections such as Returns and Yields we don't require additional indent for lines following the summary.
GitOrigin-RevId: 5dd7adf5f9042204a29b731a3a7379cc3c743af9
Previously in docstrings we incorrectly recognized references in 'Attributes' section only as instance attribute references. It led to false positive 'Unresolved reference' on class attributes references in docstrings and wrong resolve when using class and instance attributes with the same names. Now we use ReferenceType.VARIABLE to identify both class and instance attribute references in 'Attributes' section and then resolve them with priority of instance attributes. Also fixed wrong resolve of attributes references to constructor parameters.
GitOrigin-RevId: ea10bfb092472c0ab14b77f06efd93093cfcd684
`Jump to source` or double-click action now moves cursor to the first usage of the selected function inside other function, not to the definition
If there is more than one usage of the function A inside function B, it is now shown with an additional label like `(3 usages)`
PY-55537 Call Hierarchy: don't show last node as expandable
Last node no longer shown as expandable if it has no children
Merge-request: IJ-MR-25288
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>
GitOrigin-RevId: ea290dc20f03207a8197e7e2ec2d5d17232c3d72
Also fix PY-55231
Add declarationElement field to callable parameter to resolve parameters to class fields in dataclasses
GitOrigin-RevId: ae2703b958061df6f2d74b19920a6e3be2a084f6
This is a workaround until PY-53896 is implemented.
It effectively brings the stubs for builtins in Typeshed to their state at
37ee52ec2d883d8bbf244e4d1a871cde7f678d17, with the exception that I kept new
definitions for __build_class__ and ExceptionGroup (for 3.11).
GitOrigin-RevId: 92fdf169d228c52bcefa7edc3f185cb931ff4d79
While resolving an aliased method exported from a module, we might lose
the context that it was referenced via instance and hence its first "self"
parameter is already bound and doesn't need to be passed explicitly.
The reason is PyResolveUtil#doResolveQualifiedNameInScope (called in
PyTargetExpressionImpl.multiResolveAssignedValue) performs resolve
over qualified names saved in PSI stubs and returns plain PsiElements
(end results) that don't retain such information about their qualifiers.
QualifiedResolveResult can't be used there either because we don't keep
PyExpressions in PSI stubs. What's more, when later such function is referenced
via some module we consider it definitely unbound, even though a module cannot
possibly have a method as its immediate attribute. I changed the logic so that
we no longer consider referencing a method through a module as somehow affecting
its bound/unbound state.
GitOrigin-RevId: 17a6c3e5d43c088d0663ba54651004c8370d5eca
Makes it possible to mark individual TypedDict keys as required or not required, covered in [PEP-655](https://peps.python.org/pep-0655/)
GitOrigin-RevId: 6567fd1009430e37f32924eb29ab8b4a1a17f315
* Dedicated inspections for `ClassVar` variables in variable declarations, variable reassignments, function parameters, local and return variables
* Types of `ClassVar` variables now resolves correctly
* Tests for `ClassVar` inspections
GitOrigin-RevId: 0fd0ef0126ba2c2801ef82bcbeca4ea9b0c48c73
See ``indirect`` docs for pytest: instead of direct argument it uses fixture, so we must provide fixture return type
GitOrigin-RevId: c144a0e891f61e15f71c9c012fb99a4dd024e76f