I introduced a new type of CFG instructions, similar to ConditionalInstruction,
called RefutablePatternInstruction. The idea is that every pattern that can
possibly fail to match is surrounded with a pair of such instructions, helping
to describe how the control flow moves in each case. The PEP calls the opposite
type of patterns that always match "irrefutable", hence the name. We need these
synthetic instructions because otherwise some refutable patterns such as literal
ones (e.g. "42") don't leave any nodes in the graph. Incorporating the information
about irrefutable patterns right into the graph allows catching cases such
as "wildcard/name capture makes remaining patterns unreachable", both in OR
patterns and independent case clauses.
GitOrigin-RevId: beebe1890a6a824b188e6954a2c92f7ec52079e0
All information moved to factories.
It is now possible to check if package is installed using PyPackageService, no need to have separate service.
GitOrigin-RevId: f97d4e09cd93c6b2d46e36920b513b5b82d53dc6
All the corresponding PSI elements now have empty interfaces. The API will be
"beefed up" as we start adding actual processing of them in the code insight
(e.g. for the upcoming CFG and inspections).
The trickiest part of the parsing was the recovery. Patterns allow only
a limited subset of expression syntax, but I tried to sensibly consume and report
everything else (not building PSI for it). So that if user starts typing more
general expressions in the midst of a pattern, we still give meaningful error
messages. It seems a likely cause of errors when the feature first rolls out in
Python 3.10.
GitOrigin-RevId: fae40034964e4a25d91dab06a43d3fc07225d9c7
Now we can infer decorated method's type based on the type or
type hints of their decorators. It is possible to use several
decorators on the method.
GitOrigin-RevId: 22f934ab5be9cb49a4ae65cbd72e17a7d1505778
Namely, their bundled dependencies and tests.
Common names of test and "vendored" roots were collected based on
a base Anaconda interpreter.
Filtration is done over a module/package qualified name in its closest root,
sharing some parts of the implementation with QualifiedNameFinder.
It's likely to also be utilized in the upcoming auto-importing completion
of qualified names.
To make the customization of a search scope easier to use and extend in
the future, I introduced PySearchScopeBuilder API that allows to build
a custom search scope, excluding some irrelevant parts of a Python SDK.
I also updated the set of known standard library tests.
"idlelib/testcode.py" was removed as the only file entry that is
found only in Python 3.3, which we no longer support.
GitOrigin-RevId: 6676c59011d51371639ce24a5ac5c5b56d6b13fb
Callee is now a receiver for these cases, previously it was `null`.
Callee is not replaced with constructors to have an ability to map it onto self/cls parameters and process `(cls: Type[T], ...) -> T` annotations.
Stay with the previous behaviour for navigation and looking for target element.
GitOrigin-RevId: c0f9894cf50fd5d7fd325f095976d096fb948e89
Modules list has been updated using python on Windows, seems it should be done on all OSes and merged.
GitOrigin-RevId: 621172608fffddc3e830f1133fba89a05d092eba
To avoid possible confusion regarding its target element, the intention is now
suggested only when the caret is inside a literal part of an f-string, not at
any expression it contains.
The conversion affects only the string on which the action was invoked,
including ones in its inner expressions, but not enclosing f-strings. Hence,
converting quotes for an f-string might also change quotes of its inner strings
to preserve the syntactic correctness. Converting quotes for an inner
strings, on the other hand, is possible only if it won't break their parent
f-strings.
GitOrigin-RevId: fb997ac8e26eea728897820f0d94bd84aa9e4491
One of the compelling reasons for that is that, otherwise, they turn into
nullable types in Kotlin visitors introducing redundant checks everywhere.
Consequently, these changes break existing Kotlin implementations that now
have to remove nullable parameters from their overrides, but this is acceptable
since altering nullability annotations preserves binary compatibility,
and existing, not updated plugins will continue to function.
A note about source compatibility breakage will be added to Plugin Dev docs.
GitOrigin-RevId: 2b3549aecfbba9d7e6365d214400c202e10e61d1
Get rid of PyNamedTupleType.DefinitionLevel (finally) and PyOverridingTypeProvider.
PyNamedTupleType is updated here since otherwise we would have to provide parameters for PyNamedTupleType with NT_FUNCTION as a definition level via PyNamedTupleType.getParameters.
Update NumpyDocStringTypeProvider and numpy test data, otherwise it will return `numpy.core.ufunc` as a type for every function having special name.
See NumpyDocStringTypeProvider.getReferenceType.
Return accidentally lost behaviour in PyiUtil.findSimilarElement for classes: don't look for similar element in ancestors.
GitOrigin-RevId: e2410eaa0e0cd5f98e4a86515b4358c140b373e6