Commit Graph

4311 Commits

Author SHA1 Message Date
Egor Eliseev
6d6205dfb0 PY-49991 Load elements for groups on demand
Load Special Variables and Return Values groups only on demand

IJ-CR-20988

GitOrigin-RevId: 7c4fef6c7f3a77e01b8e3f31782440265a08823b
2022-06-28 13:51:06 +00:00
Egor Eliseev
eb833f7e5c PY-31680 Debugger Console throws error if dict contains unicode fields
Add correct handling of call 'quote' function for Python 2 and 3.

GitOrigin-RevId: e5c0840e4f5c1ff7b81ddfc0fcfba73953e8d004
2022-06-22 11:05:30 +00:00
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
Egor Eliseev
1f3642a700 PY-43591 Debugger stops twice on breakpoint if exception was raised
Add checking: if exception and breakpoint -> don't stop.
Generate binaries.

GitOrigin-RevId: 00205f00752b6ce04e6fa23129eeb2d4f3666a1e
2022-05-30 15:14:33 +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
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
Ilya.Kazakevich
2e811b78e9 PY-36334: Support `indirect` argument for pytest.
See ``indirect`` docs for pytest: instead of direct argument it uses fixture, so we must provide fixture return type

GitOrigin-RevId: c144a0e891f61e15f71c9c012fb99a4dd024e76f
2022-05-24 02:00:13 +00:00
Daniil Kalinin
fa259d0727 PY-52162 deprecated implementation of PythonTemplateContextType#isInContext changed to accept TemplateActionContext
Tests for PY-52162

Merge-request: IJ-MR-24510
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: 8cb7674b3840424015eeb06981ec16734fe26af2
2022-05-20 08:37:03 +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 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
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
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
Peter Gromov
dc01d636c5 [grazie] patch chunker-related rules to avoid false positives (GRZ-108, GRZ-30)
GitOrigin-RevId: cb59abe518d6e3b464b43bd0105d44ef5fb055ed
2022-04-25 06:36:34 +00:00
andrey.matveev
368055ab2d PY-42682 Add test adding keyword vararg to the end
(cherry picked from commit acad2e8c5c5aee3da51bb27c294a381ac7364599)

IJ-MR-22901

GitOrigin-RevId: d15a773341632dac6c4255f81b8b52a014cc3fce
2022-04-05 10:34:10 +00:00
andrey.matveev
157b37920e PY-42682 Fix IncorrectOperationException when adding keyword vararg to signature
(cherry picked from commit 24a4542fc09784ed4359ed558cd5a8e49b29bf1c)

IJ-MR-22901

GitOrigin-RevId: 6cd2544783580312e1194b3d76e47f9db88fbdf3
2022-04-05 10:34:08 +00:00
Daniil Kalinin
85f5bb3763 Tests for PY-52748 "Force new line after colon" -> "Single-clause statements" should not affect pyi-stubs
GitOrigin-RevId: 976fac3f170923a153e06a3435281f0e3436e1cd
2022-04-04 16:25:45 +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
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
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
Semyon Proshev
38dd9d9e84 Sync with typeshed @ 7682ae957a32686becaf884de26cf79c9de5b221 (PY-41510)
GitOrigin-RevId: b199b44b7611b70ddc52848dfc4f71684f49e711
2022-02-14 16:49:39 +00:00
andrey.matveev
806fa72b80 PY-51329 Fix problem with overloaded bitwise or operator chains
(cherry picked from commit f265b05500ef8a6b35e7fef090a971f4a5449453)

IJ-MR-17506

GitOrigin-RevId: 5cac0b7d071f753023b97c4e4152acbe388b8f08
2022-02-11 14:18:56 +00:00
Lada Gagina
6f6835f317 PY-46661 PY-43387 Add TypedDict type-checking in return statements, fix tests
GitOrigin-RevId: 6ec55896fce0ff0f40eb66975a7562e4383634ef
2022-02-10 23:02:32 +00:00
Lada Gagina
58815862bd PY-46661 PY-43387 Add type-checking for nested TypedDicts, fix tests
GitOrigin-RevId: c96467c83d7d584bb8a80cdbf2b5faf63735064f
2022-02-10 23:02:29 +00:00
Egor Eliseev
63a54778f6 PY-16583 Incorrect escaping in debugger
GitOrigin-RevId: 1f08062cd5715658ab17aeca3cfe52b275406936
2022-01-24 18:45:09 +00:00
andrey.matveev
0210695327 PY-26881 Use stubs for function in find usages if it exists
(cherry picked from commit 060c164c3f01a857561d5d0341a186464419e845)

IJ-MR-17639

GitOrigin-RevId: 88141ea74ff22fb022056c8d6d7f70222a3f9b74
2022-01-21 03:17:30 +00:00
andrey.matveev
2953318655 PY-38636 Fix go to declaration lead to pyi in some cases
(cherry picked from commit 33b52287f1d5241ee0bc4b8ff1c065e32f26d063)

IJ-MR-18958

GitOrigin-RevId: 5a59d6e6ea3ab001b8237d408340536abe2678e0
2022-01-20 12:03:22 +00:00
Ilya.Kazakevich
9214f0d529 Remove IronPython tests: nobody uses it
GitOrigin-RevId: 27d1b005d84e43cfc5fa831111aebcf1c65637b1
2022-01-19 14:49:27 +00:00
Peter Gromov
ba53b24979 [grazie] skip warnings in code-like contexts in all domains (GRZ-285)
GitOrigin-RevId: 053c3549c11e04209c0caaaad948af508f17fa9f
2022-01-14 14:26:13 +00:00
Bas Leijdekkers
ce078dac32 RegExp: new "Regular expression can be simplified" inspection (IDEA-286122)
Supersedes the "Asterisk closure can be collapsed to plus closure" inspection which was only available in PhpStorm

GitOrigin-RevId: a63c6fce88b3700cc521e8b113069a4b2b50a3e4
2022-01-13 20:26:25 +00:00
andrey.matveev
07ebb19aee PY-33843 Fix problem with extracting constant from comprehension
(cherry picked from commit 72bb8e523471c9922ae3d8f95f7fa9ce1fe0009d)

IJ-MR-18836

GitOrigin-RevId: dadb7cf489a0501b834cff7e10979fab2c8ae8cd
2022-01-13 07:40:36 +00:00
Daniil Kalinin
e7421b36cf PY-12106 Add newline when moving function to new file
Update all the /refactoring/move test sources according to the new rule - an empty line is always added after the move

(cherry picked from commit c00d1a499fb9849650eb102dd8bb5380165a1eee)

IJ-CR-17177

GitOrigin-RevId: d436af21c20ddd08b78886a333e6f98c71bcc19b
2022-01-10 09:40:19 +00:00
Semyon Proshev
d09cfa814b Sync with typeshed @ 48f13e451a3ef21002cca3f3b325ff3635f32d66 (PY-41510)
GitOrigin-RevId: b758ee90685ea9ad1e70cd8df2ea92afcb3f0f35
2021-12-24 13:26:30 +00:00
Daniil Kalinin
2647a25fd7 Fix for the broken test affected by 86861f573d66abd3d9100de1ebed59513838a24d
GitOrigin-RevId: 4e6d81aeccaee471568b0cff57aaba4876df0664
2021-12-16 11:22:27 +00:00
Daniil Kalinin
890f04e881 IJ-CR-16991 Highlight all parameters from the outer functions as parameters, not only self exclusively
Added test for this case

(cherry picked from commit 4019a7deb4b577eb6a42200fa4758a2624e26896)

IJ-CR-16991

GitOrigin-RevId: 86861f573d66abd3d9100de1ebed59513838a24d
2021-12-16 10:36:47 +00:00
Semyon Proshev
574a315230 Use proper type eval context while looking for callees (PY-52034)
Otherwise PyTargetExpressionImpl.getType can not infer type for a qualifier defined inside function body.

GitOrigin-RevId: 75345218653fc8507cc31498fda7b8f07d4c02c6
2021-12-10 13:47:33 +00:00
Daniil Kalinin
a83b789054 PY-24653 Fix Self highlighting in nested functions
(cherry picked from commit fbfc5683399723ac0d49e5aa337024154dd6d3a9)

IJ-CR-16991

GitOrigin-RevId: 69084562247b0105f268fac9f442e02756240173
2021-12-06 08:50:49 +00:00
Daniil Kalinin
6a0f77c6ab PY-35936 Allow formatter to fix "PEP 8: E701 multiple statements on one line (colon)"
(cherry picked from commit e955950c3d09fee9d816147a9e951af6cee53ae0)

IJ-CR-16824

GitOrigin-RevId: 0fa973ad2868e9388515d36a4f57f4ae3a28c4e3
2021-11-24 08:40:24 +00:00
Semyon Proshev
34baf00129 Remove support and tests for tensorflow >= 2.0.0a0, < 2.0.0rc0 since these packages are no longer available
GitOrigin-RevId: de628547191998ab50f1d3c9a11504151c3cbf5d
2021-11-23 19:29:56 +00:00
Mikhail Golubev
f8aecd088e EA-401551 Fix an exception when joining IFs with assignment expressions
GitOrigin-RevId: ce9610afb4e280b2930f126861bdaf13bd69021e
2021-11-23 12:34:18 +00:00
Mikhail Golubev
4dbe727d87 EA-404000 Fix NPE in case of unresolved class names in class patterns
GitOrigin-RevId: c1805f264367e026c22b12a714eb97b6acd8edec
2021-11-23 12:34:15 +00:00
Lada Gagina
315f1905fd PY-46344 Import abstract base classes from collections.abc, not collections
GitOrigin-RevId: d4b7165f09f47c7cca6c3eb47b1e254e5b855b40
2021-11-19 12:04:44 +00:00
KotlinIsland
119696be41 Add language level for Python 3.11 (PY-51300)
GitOrigin-RevId: bc2fd30744ca9c2a8023c718ade4689bfc9fef9b
2021-11-17 15:31:59 +00:00
Egor Eliseev
69b843ed0b PY-28563 "Set value" doesn't work
(cherry picked from commit 0c42984de25e97e748e719dccfe3657fc4eb79f1)

IJ-CR-15473

GitOrigin-RevId: 93090f9d81d14009120682796c11862dbe9e3e98
2021-10-26 11:28:52 +00:00
andrey.matveev
f4e98200ee PY-16221 Impl moving add from future imports when move
(cherry picked from commit b1cd64885d96c560976a29db9f5625a29df6d6ef)

IJ-MR-14916

GitOrigin-RevId: 5439442556b3d8ea2680d833109ac86559b765c1
2021-10-18 16:30:24 +00:00
Mikhail Golubev
e9d11d1215 PY-48010 Warn about problems causing SyntaxErrors in PEP 634 patterns
GitOrigin-RevId: 718645cc5dfd6d0a14f1bd802f3c5bb2bb2c6074
2021-10-18 13:57:02 +00:00
Mikhail Golubev
0686325b90 PY-49774 Warn about PEP 634 match statements in Python < 3.10
GitOrigin-RevId: 092f708faf2f35454a8214e56c2dfd6ab43b3e27
2021-10-18 13:56:58 +00:00
Mikhail Golubev
4582894569 PY-50943 Fix NPE caused by now null-hostile immutable collections in PyNames
I also went through other places where these collections are used and updated
them where needed.

GitOrigin-RevId: d74bcea57e0ab71273837e3c443b600bfd64ff3b
2021-10-16 09:04:24 +00:00
Irina Fediaeva
086905baef PY-23831: Add imports for references from type hint comments during 'Move' refactoring.
(cherry picked from commit c4e5e33459d273b159760a45f528ff1d38c55add)

IJ-CR-13802

GitOrigin-RevId: 3e78b51151d9803e870164c1f2d3d783c61071f7
2021-10-16 07:08:19 +00:00