Commit Graph

126 Commits

Author SHA1 Message Date
Alexey Kudravtsev
3e50d9d2c4 sort semicolon-separated extensions within "extensions" attribute of <fileType> in plugin.xml to ease the maintenance
GitOrigin-RevId: 06b3061fdb7bfed840a7bb58e4725e3351b37b40
2021-06-18 23:41:42 +00:00
Semyon Proshev
03ec7fd6af Remove constant resolve contexts because they were almost always updated with another type evaluation context
GitOrigin-RevId: 7390874410af7264dbee695d0a339d20d3f3b35b
2021-06-13 14:50:13 +00:00
Semyon Proshev
d76048f17e Make all resolve context initializations to be with explicit type evaluation context
GitOrigin-RevId: 1814d37684ef355cb224a6fedad873667cc0970e
2021-06-13 14:50:12 +00:00
Semyon Proshev
7b8b5bb12f Make creating resolve context with explicit type eval context shorter
GitOrigin-RevId: 7dce0f1869ca114d729f8368273291940eda21ef
2021-06-13 14:50:11 +00:00
Mikhail Golubev
cb08d4de98 PY-48760 Implement CFG for PEP-634 match statements
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
2021-06-11 10:16:38 +00:00
Semyon Proshev
12633a37e2 Apply API changes planned for 2021.2 (PY-43884)
GitOrigin-RevId: 6437eea19fa1885199c9988912e7d558be644953
2021-06-03 19:54:50 +00:00
Ilya.Kazakevich
480de17a92 Get rid of PyTestFrameworkService
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
2021-05-28 23:17:29 +00:00
Mikhail Golubev
639b8d1029 PY-48008 Implement parsing of PEP-634 match statements
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
2021-05-24 10:28:29 +00:00
Dmitry Jemerov
749ce8a332 Cleanup: remove @author tags
GitOrigin-RevId: 9174eb8d77215b16f9f6c6074e6aced654d95ef1
2021-05-03 13:07:48 +00:00
Semyon Proshev
78c5130604 Remove special processing of PathLike
Triggered by https://github.com/python/typeshed/pull/5242

GitOrigin-RevId: 3bc2be4bcf1ccc652c7fbee4d730c871c30728c8
2021-04-28 00:06:59 +00:00
Andrey Vlasovskikh
6d8428ee4e PY-46321 Renamed PyDocstring into Doctest to make more sense as a user-visible name in Markdown code fence blocks
GitOrigin-RevId: 1284ab756e522db0c8109b59d6d78b1d1f503a7f
2021-04-27 17:32:03 +00:00
Andrey Vlasovskikh
1c353a809a PY-45206 IJ-CR-3996 More null safety
GitOrigin-RevId: 98a84a10f2b50e76ae416140fecff8d05d42bbe2
2021-03-30 14:27:03 +00:00
Vladimir Krivosheev
809b7ca201 deprecate ServiceManager.getService(project)
GitOrigin-RevId: 3805c3aac4e084c828558bf1b1570339f7f3b4a3
2021-03-26 21:30:32 +00:00
andrey.matveev
3322cedc0d PY-19917 Support type ignore comments
(cherry picked from commit 693b7f2bf037ac9fd464e330390c76ee5268c023)

IJ-MR-5695

GitOrigin-RevId: 354a4ba98e0ff01787ae0718c8643772b118fc9f
2021-02-15 16:45:22 +00:00
Nikolay Chashnikov
ebda80c42c deprecation: add @ScheduledForRemoval annotation to deprecated elements (IDEA-259329)
GitOrigin-RevId: 8ab1f92485b718807bac77682b7038c42c65dba1
2021-02-12 16:33:25 +00:00
Mikhail Khorkov
28ff3568f3 PY-37362 PY-27142 Add infer types of decorated methods
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
2021-02-08 08:21:27 +00:00
Mikhail Golubev
02fe07c5a9 PY-46381 Don't suggest internal parts of third-party packages to user
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
2021-01-27 16:34:15 +00:00
Semyon Proshev
3870a30d6b Drop elements scheduled for removal in 2021.1 (PY-43884)
GitOrigin-RevId: 9f7acf5b888da6a376868ea8c8d405e99000044f
2021-01-27 11:25:38 +00:00
Mikhail Golubev
4bd9617ad8 Implement equals and hashCode for RatedResolveResult and inheritors
In particular, allowing to easily filter out duplicates if needed.

GitOrigin-RevId: c04879e9b5e7eb99caa6603f4d9c223c752a1248
2021-01-18 15:36:43 +00:00
Nikolay Chashnikov
9949e0df54 [python] API cleanup: remove unused API which was deprecated for a long time (IDEA-259329)
GitOrigin-RevId: dd6533550122358eed8de2822341e94256d2185c
2021-01-15 22:21:45 +00:00
Nikolay Chashnikov
af87f2c760 [python] API cleanup: delete unused scheduled for removal API (IDEA-259329)
GitOrigin-RevId: 67764f0e2418eb92b13a59e2c6f25dc503b0d582
2021-01-13 13:39:54 +00:00
Irina Fediaeva
0f6abfba6a PY-44918: Fix resolve path in existing user file instead of the os.path
GitOrigin-RevId: cca701106e1c558a50ed61b85efc312ff9205b1c
2020-12-01 19:44:00 +00:00
Semyon Proshev
29ca6031ee Update PyResolveContext equals and hashCode to be correctly used in caches
E.g. PyCallExpressionHelper.multiResolveCallee(PyCallExpression, PyResolveContext)

GitOrigin-RevId: 5611be41aa8422c6e08958dcb4cccfe13036e335
2020-11-12 13:18:40 +00:00
Semyon Proshev
524414bedb Minor refresh in PyResolveContext
Not null type eval context, nullability annotations, reduced memory footprint

GitOrigin-RevId: 25df5df053e6d50419dd5723a932285dd97bdd2d
2020-11-12 13:18:38 +00:00
Semyon Proshev
fbbb78bc4e Change receiver for initialization calls and don't resolve callee to constructors
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
2020-11-11 19:30:34 +00:00
Semyon Proshev
be15656e6d Move PyCallExpression.getReceiver implementation to its inheritors
GitOrigin-RevId: 3aa2361564964ed01e96cc72e2601d8d3793b154
2020-11-11 19:30:32 +00:00
Vladimir Krivosheev
95f00ec6d3 IDEA-252162 regenerate icon classes
GitOrigin-RevId: b20a64c7d0832b0bc7b8a85f3a2c039e63a8e965
2020-10-20 10:54:03 +00:00
Semyon Proshev
4bda118750 Make LanguageLevel.toPythonVersion instance method
GitOrigin-RevId: 133ad26d0952922b57b090dc4e597dc6e3be003e
2020-10-19 16:36:19 +00:00
Semyon Proshev
0f948ef5f0 Align inner representation of python 2 versions with python 3
GitOrigin-RevId: 268e221f9082fd5c26479822c02a233ea99a7663
2020-10-16 12:24:43 +00:00
Semyon Proshev
08a5ecdd86 Remove future features that are mandatory in the supported python versions, change bounds type to language level
GitOrigin-RevId: 13c3e6ec4248d38338d09d1c3f87da6006d1ce5a
2020-10-16 12:24:36 +00:00
Semyon Proshev
2068860a9c Remove language levels flags that depend on major python version
GitOrigin-RevId: 8fc2650426de84eea628da24deb83e2adee46130
2020-10-16 12:24:34 +00:00
Semyon Proshev
d30fc4f7bc Inline language level flags that are constants in supported python versions
GitOrigin-RevId: 5e381b72505c1d896028da83b7044be51e408f0b
2020-10-16 12:24:31 +00:00
Semyon Proshev
0df101b3a7 Remove deprecated marks from unsupported levels since it is highly unlikely that someone will use them with no reason
GitOrigin-RevId: ee6ecef3b8c080c6a76adc3f78883a4e2c0642dc
2020-10-16 12:24:29 +00:00
Semyon Proshev
860672992e Add language level for Python 3.10 (PY-44857)
Additionally several mandatory python versions have been aligned in FutureFeature.

GitOrigin-RevId: bfeba8d465c593c1000ed0f5226a4ab2a918a2bf
2020-10-16 12:24:27 +00:00
Semyon Proshev
8ea99aff29 Drop elements scheduled for removal (PY-43884)
GitOrigin-RevId: 9bc491cf35e17984cd1cb447c914ff702332d3af
2020-10-09 08:58:18 +00:00
Semyon Proshev
b9281dd55f Mark python 3.5 as unsupported and update 3.9 modules list (PY-41512, PY-44853)
Modules list has been updated using python on Windows, seems it should be done on all OSes and merged.

GitOrigin-RevId: 621172608fffddc3e830f1133fba89a05d092eba
2020-10-08 14:37:43 +00:00
Semyon Proshev
efa9795241 Allow immutable sets to accept null in contains (EA-239321)
GitOrigin-RevId: 8e1f4c8f92844610a2741dc59885477b0b4fb0a0
2020-10-01 17:47:39 +00:00
Vladimir Krivosheev
ef799565a0 cleanup
GitOrigin-RevId: db50f41393f2464428b605fbf1dafcb5c62ed508
2020-09-30 06:38:16 +00:00
Vladimir Krivosheev
b1bf65d0ae cleanup (useless comment after copyright file header)
GitOrigin-RevId: 860a889e14a1d9b9d7bbcbbd6b22a447984b81b5
2020-09-28 09:08:58 +00:00
Vladimir Krivosheev
b1d48e4312 IDEA-251219 fix rasterized prebuilt cache for dark theme
GitOrigin-RevId: 0228a057302b1d952da4870eb76d157e746c1366
2020-09-25 15:54:02 +00:00
Vladimir Krivosheev
8f5d642544 IDEA-251207 Set of plugins cannot be unloaded because of IconLoader
GitOrigin-RevId: 441b875462f12fe0d20d3830181e6280e3b829ba
2020-09-24 15:26:04 +00:00
Vladimir Krivosheev
f4fc653c06 icons
GitOrigin-RevId: febfb25205456d623c2a1d5efec70e51f9c2f0b6
2020-09-21 13:40:48 +00:00
Mikhail Golubev
9caa862fb8 Fix the javadoc of PyFormattedStringElement#getLiteralPartRanges
GitOrigin-RevId: 55489bbe4bff517e3268b612398bc3e1eb193e18
2020-09-15 06:54:04 +00:00
Mikhail Golubev
9288bc605a PY-30798 Make the intention for converting string quotes work with f-strings
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
2020-09-15 06:54:03 +00:00
Alexey Kudravtsev
5d41e42767 cleanup: notnull and fix Processor type parameter types
GitOrigin-RevId: 694f1cf4f8b2602e5a0e199c92490e68ec303c1b
2020-09-14 13:46:01 +00:00
Mikhail Golubev
80023909b4 i18n: Annotate Python UML diagrams support
GitOrigin-RevId: 492135bbc194d71e7a869ef591be574b1225b66b
2020-09-05 16:32:47 +00:00
Vladimir Lagunov
226772ce74 i18n: Various @NlsSafe annotations for Python.
GitOrigin-RevId: 85237d4dd6fc1da108e3d7525cfdcc9d41a5fd37
2020-09-02 13:48:58 +00:00
Mikhail Golubev
45882b10bd Consistently annotate PyElementVisitor method parameters as @NotNull
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
2020-08-31 20:07:16 +00:00
Semyon Proshev
609f07aa41 Fix calculating implicit offset for __new__
GitOrigin-RevId: 0245f3d77a0fb7c421838f6ca97206885f2ae4a0
2020-08-24 18:58:45 +00:00
Semyon Proshev
d8873570c5 Update PyCallExpressionHelper.getCallType to ask callee type for result
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
2020-08-24 18:58:43 +00:00