Commit Graph

92 Commits

Author SHA1 Message Date
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
Lada Gagina
0dcb9cb443 i18n: Interpreter settings
GitOrigin-RevId: ae4251440959bd70d01402b35c1a6b19a275524b
2020-08-21 17:07:43 +00:00
Mikhail Golubev
4e6f24e302 Add PyElementVisitor#visitPyDecorator. Simplify usages of visitPyDecoratorList
GitOrigin-RevId: fe190873406cd1f65e349d0e9255522182a7b733
2020-08-14 11:03:44 +00:00
Mikhail Golubev
3e95076004 PY-35624 Don't suggest renaming magic literals for any part of an f-string
Since, in general, the exact value of such literals can't be known statically,
hence it's just not safe to base a refactoring on them.

I've introduced a new method PyStringLiteralExpression#isInterpolated that
detects whether a literal contains any embedded expressions. It might be
useful in other actions that don't properly take f-strings into account yet.

GitOrigin-RevId: 73ee91a175399576a751d3ec4b590a2e7f171e67
2020-08-10 16:03:10 +00:00
Vladimir Lagunov
bd0bc48cdd IDEA-CR-64185 Rename pythonNotebook.svg -> iPythonNotebook.svg
GitOrigin-RevId: 73b9eae56a84e499629030d4e16691f17747ec56
2020-07-27 06:36:12 +00:00
Tagir Valeev
4d21ad341f Annotate bundle methods as Nls
GitOrigin-RevId: db851b498d99f538e1f747faa4fb4d954848982f
2020-07-17 07:46:42 +00:00
Semyon Proshev
887deb0dd7 Get rid of MakoArgumentListInspection and implicit offset in PyCallExpression as a result
GitOrigin-RevId: 2cc1155a0c22752bb47158cf50a58c9948ffd146
2020-07-14 14:44:39 +00:00
Stanislav Utikeev
d8e63de195 LAB-31 Extract documentation service EPs to analysis API
GitOrigin-RevId: 6c4f05e4a625b9a855f0371cf2b39603fa4cc624
2020-07-10 12:29:55 +00:00
Semyon Proshev
2ff5b1ea46 Remove api notes in favor of annotations
GitOrigin-RevId: a5a74d65dd2b0e820047ef10d6a74e1d3bf604b6
2020-07-09 12:08:14 +00:00
Mikhail Golubev
f3e81f8d68 Fix stub handling in a few type providers by introducing StubAwareComputation API
It turned out that several existing type providers incorrectly processed PSI
stubs, returning nothing in cases when TypeEvalContext prohibits accessing AST,
but the containing file was already unstubbed, leading to inconsistent "flaky"
analysis results.

Since the pattern for safe accessing AST vs. stubs properly taking into account
both TypeEvalContext constraints and StubBasedPsiElement.getStub() is notoriously
tricky to get right, and it's not the first time to such problem was discovered,
we tried to hide this logic behind a new experimental API -- StubAwareComputation
and migrated those type providers to it. Other code insight parts that need to
operate on stubs, especially custom ones, might follow.

This change is a joint effort with Semyon Proshev who came up with an initial
draft of the new API and updated all the affected type providers.

GitOrigin-RevId: 2ea467d85a6d30e37049edacd5eb4a32768f5252
2020-07-02 11:05:57 +00:00
Vladimir Lagunov
4eca06a261 Jupyter: rename icons according to icon naming guide.
GitOrigin-RevId: 639907bff11c0a2925ac0b32d41d8ab84752c47a
2020-06-30 13:55:16 +00:00
Vladimir Krivosheev
d4e9b09e26 cleanup (final)
GitOrigin-RevId: 93607e195763f2acf29ee0d7a280d7e07e8d2f14
2020-06-26 12:21:17 +03:00
Vladimir Krivosheev
ceda0e1202 prefer JDK collections
GitOrigin-RevId: 699d98435b9b1378d584868e780458e06f9cf56d
2020-06-24 17:31:08 +03:00
Mikhail Golubev
a717a7c145 PY-41305 Update PyDecorator API and docs for PEP 614
- Added PyDecorator.getExpression() to reflect that in Python 3.9
an arbitrary expression can be used after "@". Reused it where possible
in the implementation.
- Removed hasPlainReferenceCallee() in favor of existing getQualifiedName().
Updated javadoc for the latter to clarify how it handles non-trivial callees.
- Added PSI stub tests to make sure that right values are still persisted
with the new flexible decorator grammar.

GitOrigin-RevId: 8109b834c8d257c72f6f6e3c0ce5005060a2b971
2020-06-20 17:29:44 +03:00
Lada Gagina
2e617b803c IDEA-CR-63687: PY-41305 Add PEP 614 support
Allows to use any expression as a decorator

GitOrigin-RevId: e92af1ebd2c4d7024971fd4542bfe52640faaa26
2020-06-17 00:30:49 +03:00
Mikhail Golubev
16eebe034e PY-25001 Implement Complete Current Statement for collection literals
It works by automatically inserting a trailing comma before a line break in
multiline collection literals. Additionally, a colon is inserted between a key
and a value in dict literals.

Because of the language ambiguity regarding syntax of some incomplete collection
literals, colon is not inserted after the first key of a dict literal
(it's indistinguishable from a set literal with one item), and comma is not
inserted after the first item of a parenthesized tuple (it's indistinguishable
from a parenthesized expression).

The idea was taken from such implementation of Complete Current Statement for
JSON.

GitOrigin-RevId: 49ff9857d8c12476bfa9aacaed0b49faa99810fd
2020-06-10 22:57:53 +03:00
Semyon Proshev
0c9a0b6d41 Don't consider Python 3.10 as having Python 3.1 language level (PY-42855)
GitOrigin-RevId: 478753c4dfb2924e6e23b261be05119bf05f86e9
2020-06-08 22:36:59 +03:00
Peter Gromov
c6a1aeacb2 cleanup PsiCacheKey, remove deprecated tracker support
GitOrigin-RevId: b8910bd487b49152eab0aa5183c9c34482836c53
2020-06-03 22:50:05 +03:00
Semyon Proshev
ba337f5f81 Replace single star and slash parameter literals with constants usages
GitOrigin-RevId: 747d8eefbaa8efccd62b4b77e5e926e984882184
2020-06-01 18:55:27 +03:00
Tagir Valeev
128370d4e3 Unnecessary qualifiers removed, some other cleanup
GitOrigin-RevId: 906af988c0b66ecaee588dfb5e16a1801051df97
2020-05-27 07:24:15 +03:00
Petr Golubev
b321cd9a3d intellij.python.jupyter.psi module extracted
GitOrigin-RevId: 4af675a3ba6bc6bf1177c5f2a5e6cb702cc81ba6
2020-05-15 16:00:58 +00:00
Semyon Proshev
e0a2c6bed7 Move file-level language level processing to PythonLanguageLevelPusher
GitOrigin-RevId: f3be772f643c75652ea3557ef34ec62518a558d2
2020-04-29 22:04:28 +00:00
Semyon Proshev
b9a7df929c Make PythonLanguageLevelPusher saving string into user data holders (PY-41923)
GitOrigin-RevId: 53b43afda6758e21f7022ee2b2326db547628c31
2020-04-29 22:04:28 +00:00
Mikhail Golubev
bb0c52a8c8 PY-41923 Don't cache extensions of Pythonid.knownDecoratorProvider
GitOrigin-RevId: 91999f358b91e38d4014c8261a9ad7f247638c88
2020-04-29 22:04:28 +00:00
Mikhail Golubev
267352c40e PY-41923 Mark more EP in python-psi-api as dynamic
GitOrigin-RevId: 680ebde56378bb1e94114ed2430297924c6df69a
2020-04-29 22:04:28 +00:00
Mikhail Golubev
0a6c2ee133 PY-41923 Mark some safe Pythonid EPs as dynamic
GitOrigin-RevId: 8fa8c36d5671be1a5df3cf30e414a85987c634a8
2020-04-29 22:04:28 +00:00
Semyon Proshev
e219ead527 Make several EP dynamic (PY-41923)
PyBreakpointHandlerFactory, PyConsoleOptionsProvider, PyPregeneratedSkeletonsProvider, PyClassMembersProvider, PyCanonicalPathProvider and PythonVisitorFilter

GitOrigin-RevId: d5b55eae82a2b1334ecbdcadc2bfe7c3a2f29512
2020-04-29 22:04:28 +00:00
Semyon Proshev
4ee0890a8a Make PythonDialectsTokenSetProvider a service (PY-41923)
No caching at the moment.

GitOrigin-RevId: 830494e178f8177073134b3fb674e332ce2e18b6
2020-04-29 22:04:28 +00:00
Ilya.Kazakevich
18c1e98d54 Logging deprecated method usage
GitOrigin-RevId: f477b9aa83e5337399a5b798a21cd0d5c1490d7c
2020-04-26 22:37:36 +00:00
Vladimir Krivosheev
444b7d3d40 get rid of Lists.newArrayList
GitOrigin-RevId: d785fe6fab133812585561c391d7d3556d5792f7
2020-04-16 08:29:17 +00:00
Semyon Proshev
55499dd783 Attempt to reduce idempotence checker failures by reducing number of thread locals and updating recursion keys.
GitOrigin-RevId: d6a50f0ac753d8b0add67baa61ac97209dcbbaff
2020-04-09 14:09:04 +00:00
Dmitry Trofimov
d799d9d4d7 Move other Python inspections to python-psi-impl
GitOrigin-RevId: 71e300329addb702f3f603f58174f3f16e688ad6
2020-03-30 15:02:49 +00:00
Semyon Proshev
48a4a4a8bc Add Python 3.9 language level (PY-37458)
Additionally, I did the following:

* re-generated lists of supported/unsupported interpreter modules
* updated test data wherever Python versions appear in warnings

GitOrigin-RevId: 66fd298e6051bf91fb894e037a877d0b382da337
2020-03-26 13:31:44 +00:00
Ilya.Kazakevich
a74449eb97 Fix django tests: PyCustomMember and it's MyInstance elements must implement equals/hashCode.
IdempotenceChecker ensures that several lookup calls in the same psi element provide same list of elements. While it is true for Django, instances of PyCustomMember are different physically, so IdempotenceChecker can't check if they're equal or not.

This change implements equals/hashCode for em to fix it.

GitOrigin-RevId: 8aad569020ae718aeafc737c97f9864fda9d7a69
2020-03-24 17:04:23 +00:00
Alexey Kudravtsev
ae21cc79ff IDEA-175757 Support File Type mapping based on shebang
Add ability to detect file type based on hasbang (#! string) inside the file contents (via FileAssocTable.findAssociatedFileTypeByHashBang()).
Store/persist hashbang patterns in FileTypeManagerImpl.
Enable users to configure hashbang associations via Settings|File types UI.
Allow plugins to configure hashbangs via <fileType hashBangs=""/> in plugin.xml
Replace some no more needed HashBangFileTypeDetectors for standard langs with xml configs

GitOrigin-RevId: 14335912b90f2d4f665d2a71eddeebf5cfc91f30
2020-03-19 19:23:01 +00:00