Commit Graph

886 Commits

Author SHA1 Message Date
lada.gagina
6bdc3d4237 PY-53611 Add support of Required and NotRequired TypedDict type specifications (PEP-655)
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
2022-06-21 20:29:34 +00:00
Alexey Kudravtsev
f82efb1a29 codestyle settings: notnull
GitOrigin-RevId: 23b0698670f6417b909a98b070ee0ad4c0340118
2022-05-31 12:28:41 +00:00
Ilya.Kazakevich
c400e65470 `target://` prefix is redundant.
According to new rules we store real target path (path on the target) as sdk home path

GitOrigin-RevId: 04ad31b24a72b83c19d2d88b3853b986534d8e59
2022-05-30 18:20:34 +00:00
Elizaveta Shashkova
6e383650ca PY-53776 Support the syntax changes of PEP 646 Variadic Generics
GitOrigin-RevId: 6ee5939eff1c0503132b013c6469de00b50b2d86
2022-05-30 09:40:36 +00:00
Alexey Belkov
9b5e8782f3 Run Kotlin inspection "Redundant nullable return type" on whole project
Plus some minor cleanups due to changed nullability.

GitOrigin-RevId: 406cf3bb86a9d1d57aa088bc0ff43cca5a8c2254
2022-05-27 22:07:13 +00:00
andrey.matveev
a50487b100 PY-50403 PY-50404 Analyse param spec container parameters
GitOrigin-RevId: 2b7653d2b52788673fcf61cdb038620162c232da
2022-05-25 13:58:22 +00:00
Daniil Kalinin
44d07d2450 PY-20811 Support for typing.ClassVar type annotations (PEP 526)
* 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
2022-05-24 20:12:55 +00:00
Alexey Belkov
bc35c5c199 Run Kotlin inspection "Variable declaration could be moved inside 'when'" on whole project
GitOrigin-RevId: a55631180acd3340bded3e0cdfa46bf3afb3cf94
2022-05-23 16:44:11 +00:00
Alexey Kudravtsev
b4fddace21 remove useless "Created by IntelliJ IDEA." comment
GitOrigin-RevId: ca35f9ed009945c2214d2c427ef2999148d8cf43
2022-05-20 16:45:58 +00:00
Daniil Ovchinnikov
2787685412 deprecate PsiModificationTracker$SERVICE
GitOrigin-RevId: ad1f9c262e0bdc68e5bb0969b26f2687c86db6ce
2022-05-18 10:28:44 +00:00
Daniil Ovchinnikov
2ba99ea824 deprecate PsiParserFacade$SERVICE
GitOrigin-RevId: 343d3419ec9f64acdbc1ff2bb8d2218b8c14d818
2022-05-18 07:55:01 +00:00
andrey.matveev
ecd113fc12 PY-52930 Support except star
(cherry picked from commit 4d03313cce07e4c3ff4748328cf2e04ba74b8d91)

IJ-MR-24242

GitOrigin-RevId: fa6c1b9077ef78b35c8f3453debcf06bcbc96364
2022-05-18 00:19:37 +00:00
Daniil Ovchinnikov
78c3e54c63 deprecate ProjectFileIndex$SERVICE
GitOrigin-RevId: 725283401fc7db28fd332d72eaa67e3a8e175259
2022-05-17 20:13:19 +00:00
Daniil Kalinin
ded2dafba4 PY-28496, PY-27660 Remove unnecessary Normal Indent which violates PEP8 codestyle rules in multiline call chains
GitOrigin-RevId: 77e738367c33673c5c5f4b46472c3a49a5f64142
2022-05-12 13:46:52 +00:00
andrey.matveev
a66dea2997 PY-50401 Impl checking name argument in ParamSpec
GitOrigin-RevId: 655026dceea03b1697e5d39ce897f2ef1f25948c
2022-05-06 12:15:27 +00:00
Daniil Kalinin
fb11ee327c PY-53200 do not autocomplete parameter list if method already have one
Test for PY-53200

Better tests for PY-53200

PY-53200 Removed unnecessary test.

`testMethodNamesDoNotDuplicateParameterList` renamed and moved closer to the corresponding ones
Removed test for method names in suggestions restored

GitOrigin-RevId: 51b0721190718c44810c16e198bad583c2af67d0
2022-05-05 11:18:29 +00:00
Mikhail Golubev
ea039cfc94 PY-42200 Annotate PyWithItem.getExpression as @NotNull and update usages
Parser was changed so that it no longer produces empty PyWithItem elements
after trailing commas.

GitOrigin-RevId: f730e68644f3444269d65d157b666267755e0d2d
2022-05-04 12:31:42 +00:00
Mikhail Golubev
97b22aaa13 PY-42200 Support parenthesized context managers in Python 3.9+
In case of syntactic ambiguity with previous versions of the grammar, such as
"with (expr)" or "with (expr1, expr2)", PyWithStatement is still parsed as
having its own parentheses, not a parenthesized expression or a tuple as
a single context expression. The latter case, even though syntactically legal,
is still reported by the compatibility inspection in Python <3.9.

These changes also include proper formatter and editing support (e.g. not
inserting backslashes on line breaks inside parentheses), as well as
Complete Current Statement, which now takes possible parentheses into account
while inserting a missing colon.

The changes in the formatter are somewhat ad-hoc, intended to minimize the effect
on other constructs. "With" statement is somewhat special in the sense that it's
the first compound statement (having a statement list) with its own list-like
part in parentheses.

Existing tests on with statement processing were expanded and uniformly named.

Co-authored-by: Semyon Proshev <semyon.proshev@jetbrains.com>

GitOrigin-RevId: 15c33e97f177e81b5ed23891063555df016feb05
2022-05-04 12:31:37 +00:00
Mikhail Golubev
c6a15fa65b Simplify a check in CompatibilityVisitor
GitOrigin-RevId: 14bc99af4e89c443bba2f8569fdfad0053459fe4
2022-05-02 15:26:54 +00:00
Lada Gagina
cc86fa5983 Fix NPE in PyDictLiteralCompletionContributor (EA-468833)
GitOrigin-RevId: 4b3c9f0e126ab0f8724cfd7e8b1ad0758540732e
2022-04-22 13:02:23 +00:00
andrey.matveev
1d609e360c EA-485045 Add check for empty argument list in PyMultipleArgumentsCompletionContributor
GitOrigin-RevId: 8a127dc0cb1cb032b5630658a75c0549d5300ad6
2022-04-07 06:02:10 +00:00
Alexey Kudravtsev
9d58c2ab19 fix non-latin symbols inadvertently mixed up with latin
GitOrigin-RevId: 13beb89a6bd42b5fa69aab57862236867d3eaf61
2022-04-06 11:05:48 +00:00
Aleksei Kniazev
05a99b5e99 [python] support Pathlib-style path declarations in PyPathEvaluator (PY-13911)
(cherry picked from commit 3673aa3bac948bae5c7e8fd6521f251285d70cf9)

IJ-MR-17579

GitOrigin-RevId: 17d336d8f6d5e16bd3dca815c2f9935911e050ee
2022-04-05 11:10:41 +00:00
Aleksei Kniazev
effa066a2d [python] switched PyPathEvaluator to nio
(cherry picked from commit f6971ee81c260b18df28c815dd2fb82551a11de2)

IJ-MR-17579

GitOrigin-RevId: b02a05a918edc1332d3550db5f118fc62ae8d86e
2022-04-05 11:10:38 +00:00
Lada Gagina
30cd450db3 PY-43689 Don't report forward references and Union types using the | operator in PyTypedDictInspection
GitOrigin-RevId: e57faacb50143381341c9320894106a9df88618e
2022-04-04 18:28:06 +00:00
Daniil Kalinin
aa26dc5e80 PY-52748 "Force new line after colon" -> "Single-clause statements" should not affect pyi-stubs
GitOrigin-RevId: 9692ddefbfa0f315bd462862c3c6ec35f7dc30fe
2022-04-04 16:25:41 +00:00
Alexey Kudravtsev
f9373981a9 deprecate createWeakMap() in favor of java.util.WeakHashMap as more standard; retain only the custom hashing strategy variant of the former
GitOrigin-RevId: 64880ac5662a95e17df6915603ef52cf111e92c9
2022-04-01 15:07:14 +00:00
Vladimir Krivosheev
8a38317c23 cleanup
GitOrigin-RevId: 8cc592b4a987143ede26092986d3678393f1abd2
2022-03-27 18:52:50 +00:00
Vladimir Krivosheev
a8f6a48409 add jdom to source code to modify and strip to our needs
GitOrigin-RevId: 3e16d0d954aa7bc45c4eadb91164b44e4b2e75d3
2022-03-27 18:52:47 +00:00
Yan Zhulanow
7a9d3ed1d7 Deprecate 'com.intellij.util.containers.isNullOrEmpty()'
The duplication is redundant as the platform implementation is identical to one in the Kotlin standard library. Moreover, it lacks a contract definition, preventing smart casts.

GitOrigin-RevId: ff97be37b183707e5d074ce2e56a90e3e9325d87
2022-03-23 07:43:40 +00:00
Lada Gagina
b8c68586bc Sync with typeshed @ 4e87b9058f0908fa895076c0d9643e18be785be6 (PY-41510)
GitOrigin-RevId: 31a3e761d5a4e2508e2eceb33170e8283bedcb36
2022-03-15 14:03:04 +00:00
Alexander Bozhnyuk
55ed7e1337 DS-2598 Fix: IPython magic commands needs to be resolved without '%'
Also fix for resolving display function in new versions of IPython

(cherry picked from commit caff9663d783310b13e55d4387e2b36b58e3ac23)

IJ-MR-19104

GitOrigin-RevId: 3f8d28b9464b62545e342acf2ccd0fbe15b9839d
2022-03-14 11:09:01 +00:00
Evgeniy.Stepanov
a59e2445ef [python] Do not try to store module settings if module does not support it, fix RIDER-65749
(cherry picked from commit 176cdfa247412ada05300429cde63a2c8fbb0c3c)

IJ-CR-21584

GitOrigin-RevId: 4ae79745171c032a76d00f79343220ac2e3118bf
2022-03-03 08:40:24 +00:00
Mikhail Golubev
1837cf5e0c Display more information about target expression stubs in "View PSI Structure"
I had to additionally implement toString() for all custom expression stubs
because otherwise the default Object.toString() breaks the platform test
checks on stub tree consistency (new and updated trees have different text).

GitOrigin-RevId: 35cd97df916836d0443b1177bfa5885864010a68
2022-02-25 19:32:05 +00:00
Mikhail Golubev
db8e5c2e2e PY-47962 Start-match non-imported module names in completion
This way we further reduce the number of irrelevant completion items suggested
effectively in every expression context, e.g. not suggesting "parser" and
"calendar" modules for the "ar" prefix, only something like "argparse" or
"array". The same applies to the completion of attributes with unresolved
qualifiers.

GitOrigin-RevId: 7a58053c4744c3d0066c379a4f190ffd09bfabd1
2022-02-23 11:55:19 +00:00
Mikhail Golubev
5ca605ccab PY-47962 Put non-imported module names last among completion variants
By giving them an explicit priority lower than the default. Unfortunately,
it doesn't remedy the problem with short module names, such as "re" or "sys",
always being on top when they completely match the entered prefix.
At the moment this behavior is hard-coded in the platform and cannot be
altered by language plugins. It's not caused by the "liftShorter" classifier.

Also, explicitly prioritizing various lookup elements has become quite messy
and scattered across PyCompletionWeigher and specific contributors. It begs
to be refactored, but will be addressed separately.

GitOrigin-RevId: d6f6ad06f5d68f3de7b866b8240a95b785604649
2022-02-23 11:55:15 +00:00
Mikhail Golubev
ff82f4e058 PY-47254 Don't duplicate already imported module names in completion
By running the completion contributor for non-imported modules after everything
else, including the LegacyCompletionContributor offering names present in
the scope, and filtering out duplicate variants.

GitOrigin-RevId: 98982b2c33d1fc11d70b144de556a6825bd3febc
2022-02-23 11:55:12 +00:00
Semyon Proshev
de4f709c09 Change looking for helper root when running pycharm from sources
It now supports running after compiling with JpsBootstrap that makes another modules structure.

GitOrigin-RevId: d3e3a0598d5cabaa436bc7ce7bfec53b3919343a
2022-02-22 15:29:28 +00:00
Dmitry Trofimov
aacc1d4ac5 Fix messages according to https://jetbrains.team/p/ijpf/reviews/4476/timeline
GitOrigin-RevId: cd390d2c7cf61f43a554d198f98f7375d872ffa5
2022-02-22 11:29:30 +00:00
Dmitry Trofimov
8d6f3c7566 Fix messages according to https://jetbrains.team/p/ijpf/reviews/4343
GitOrigin-RevId: cc2a22c7ff04abc7e5d9b763e1f67ba144d47462
2022-02-22 11:29:28 +00:00
Lada Gagina
c7d12e929d PY-40007 PY-41546 Add completion for keys of dict literals marked as TypedDicts
- in call expressions
- in assignment statements
- in return statements

GitOrigin-RevId: aea2063f7cd7ffc68903c79fa16a25fdf4ff0f8f
2022-02-21 21:13:02 +00:00
Elizaveta Shashkova
b1e8fc9ecb PY-21984 Type Renderers fixes
GitOrigin-RevId: 5911d95d52d994ac4f3e8c514b28f1008b0047e6
2022-02-21 15:44:09 +00:00
Nikolay Chashnikov
3de1d05eec [API] mark for removal API which was deprecated in 2021.2 or earlier and has few usages only (IDEA-281036)
GitOrigin-RevId: 6f1cdecf02dae3ab19351a4fa4e895f98265ea0a
2022-02-17 22:44:08 +00:00
Anton Bragin
f482e9abff DS-3171 Tests for superclass extraction in Jupyter added
GitOrigin-RevId: 32ebd1aaf156413f8f04f11a7a2f3bc1c2c13c39
2022-02-17 20:43:51 +00:00
Anton Bragin
bf28b59725 DS-3171 Extract Superclass works within a single Jupyter notebook
GitOrigin-RevId: eb2e9eb511da8a41e162ff217e23ff8a9d2bf82f
2022-02-17 20:43:48 +00:00
Dmitry Batkovich
7845515960 replace deprecated api usages IDEA-288973
GitOrigin-RevId: 8710623c8abd6f21b49f3e0f7d10639eea8b6170
2022-02-17 11:13:06 +00:00
Mikhail Golubev
3b6dea06a3 PY-21398 Wrap batch updates of existing usages in quickfixes with PotemkinProgress
It also fixes EA-425763 about using incorrect parent and anchor elements
to insert a function generated from a method of a nested class.

GitOrigin-RevId: f9b9da303396eb78c2c12b2750065dbdc0ba70ed
2022-02-17 09:28:34 +00:00
Tagir Valeev
090f452ab0 Remove unnecessary boxing
GitOrigin-RevId: 5b7d8fbfca9d58fcde762c01e564b16be44d9c1f
2022-02-17 05:40:22 +00:00
Tagir Valeev
38bfebaa23 Unnecessary fully-qualified names removed
GitOrigin-RevId: 903dbd15b9f5c307d2e17747a86d5eeecaff144a
2022-02-16 09:35:23 +00:00
Lada Gagina
b8bbabe9b1 Fix code style in PyTypedDictType, PyTypeCheckerInspection
GitOrigin-RevId: fc123ed6304b8e21d3092ed93079b6a450faa237
2022-02-15 16:58:01 +00:00