Commit Graph

195 Commits

Author SHA1 Message Date
Sergey Karpov
c0842a6fde [pycharm] Squashed commits. PY-52478 Improve the names of quick fixes for "Unresolved references" and "Non-optimal list declaration"
(cherry picked from commit bce089714657aef8634ffb9c58da57fdb576b297)

IJ-CR-112218

GitOrigin-RevId: 8857c2951e44a1e9d0b54af1eb7c584f64fbc40d
2023-07-31 16:31:00 +00:00
Mikhail Golubev
1a854fceb8 PY-55246 Enable back .pyi stubs bundled with numpy
We turned them off as part of PY-48166. Now these stubs are much more complete
and fix a number of problems with the code insight for the library (PY-35164,
PY-37461, PY-50394, PY-59347, PY-60224), most of which are caused by the lack
of information in skeletons automatically generated for its binary modules or
incorrect type information being extracted from docstrings.

I leave the possibility to disable the stubs for the time being and will remove
the registry option once it become clear that they don't cause serious problems.

GitOrigin-RevId: 0df09ddb8ca40f88b908e19c0f49f5b005abaa58
2023-07-14 14:00:34 +00:00
Mikhail Golubev
d22b8b00b9 [python] Extract a common quick fix for unresolved package problems
GitOrigin-RevId: a1db8823a2fc83424431d975e1820b415895cc7a
2023-07-06 10:41:32 +00:00
Lada Gagina
454b1287ae PY-58857 Infer typing.LiteralString for string literals
GitOrigin-RevId: 27507deabd61faedf7937415016f0f8334e5a418
2023-06-21 16:32:22 +00:00
Daniil Kalinin
157b23ce53 PY-33261 Inlay parameter hints for Python method and function calls
Merge-request: IJ-MR-108471
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: 1d9451020a755c0aaf57c12b16829f8b31291e5d
2023-06-20 05:27:45 +00:00
lada.gagina
e768aa3785 PY-40996 Add ability to collapse and expand python type annotations
"Collapse/Expand Python Type Annotations" actions, an intention and a setting

GitOrigin-RevId: e055538b29b07c1836399f52754b786a15351050
2023-06-16 19:08:16 +00:00
Trinh Anh Ngoc
c9f0c216a0 [PY-56210] Add id for PyModuleNameCompletionContributor
Allow other contributors to take priority over it if needed

closes https://github.com/JetBrains/intellij-community/pull/2197

GitOrigin-RevId: 06e7378ddb47a57dc8e934afcadd7f0d1b88bbb7
2023-06-15 20:21:10 +00:00
Olga.Lavrichenko
b221598456 DS-4113 Columns are duplicated in completion suggestions in python console
GitOrigin-RevId: 527cfd230c94b229ccf2f5d5263ba1171614cabb
2023-05-19 17:53:17 +00:00
Natalia.Murycheva
0d53aa47df DS-4878 Pandas-specific-quick-fix-replace-listdf.col.values-to-df.col.tolist
Add new intention and a corresponding quick fix for the usage pd.Series.values property from pandas library.

^DS-4878 Fixed

Merge-request: IJ-MR-106089
Merged-by: Natalia Murycheva <natalia.murycheva@jetbrains.com>

GitOrigin-RevId: 0c8dc40b09ee2d95ecd8ded532f31f5ef4a7740f
2023-05-13 20:44:29 +00:00
Natalia.Murycheva
10f22bb2e2 DS-4558 Quick fix to split a cell for statement has no effect inspection
Added a new Extension Point for corresponding quick fixes for "Statement without effect inspection." Added QF for Jupyter notebook case and Python file with cells. This QF splits cell just right after the statement without effect

^DS-4558 Fixed

Merge-request: IJ-MR-104455
Merged-by: Natalia Murycheva <natalia.murycheva@jetbrains.com>

GitOrigin-RevId: 7773895cf1ebd6d4e8d56b41e335ec8b97ca5d78
2023-05-03 15:03:06 +00:00
Louis Vignier
1869ec9da6 [codeInspection] Fix python inspection descriptions
GitOrigin-RevId: 56876a5dd073a06c3fcc92f63ed1f5674830bc25
2023-04-28 13:13:25 +00:00
Irina Fediaeva
3afa041f1b PY-32067: Highlight 'await' outside async functions as errors
GitOrigin-RevId: 9862d18848b3a826ba11e9c0e15e56a2c94bcc9e
2023-04-19 20:42:02 +00:00
Daniel Schmidt
abedaa8420 PY-39352 - use the more accurate term "CapWords" instead of "CamelCase"
closes https://github.com/JetBrains/intellij-community/pull/2403

GitOrigin-RevId: 09122e4c36fc6f40d9b79869152d0fd9f2fdeeda
2023-04-17 14:52:30 +00:00
Irina Fediaeva
bb882b63f5 PY-55118: Syntax highlighting for definition signatures in Quick Documentation
GitOrigin-RevId: b8a27a048772a0af7fcc36a9cba0d308e0ace8cc
2023-02-10 22:44:22 +00:00
Tagir Valeev
7a33190f27 [inspections] testOptPaneSanityChecks: more tests for labels
GitOrigin-RevId: 6420065945442503db628555d1f8ea14c6db2b42
2023-01-30 10:42:04 +00:00
Irina Fediaeva
252e4c1684 PY-56609: Refactoring in quick documentation
Replace usages of appendRaw by append

GitOrigin-RevId: 3ee71857898c3303a5c2e96939ab1f9fb91670e0
2023-01-23 13:39:05 +00:00
Irina Fediaeva
bd1c830040 PY-56609: Refactoring in quick documentation
Remove ChainIterable usages from quick documentation and replace with HtmlChunk/HtmlBuilder.
I18ize some fragments.

GitOrigin-RevId: c9b1197efcb17de92361426759a7840ee1be8e4b
2023-01-23 13:38:53 +00:00
Tagir Valeev
fa3cf18c12 [inspections] OptPane: use stringSet
GitOrigin-RevId: 7f3ba5c990d8aa173d8edf3a38bb21543c26d0fa
2022-12-21 19:22:09 +00:00
Alexey Belkov
390ba59bc2 Fix spelling of "quick-fix" phrase in messages
It should be hyphenated: https://www.jetbrains.com/help/idea/resolving-problems.html

GitOrigin-RevId: a3cc01babc32c3edfbe59594fa3756a415cc169b
2022-12-07 15:26:37 +00:00
Irina.Fediaeva
22327f9518 PY-46164: Rename PSI bundle for a link to copied documentation
GitOrigin-RevId: e209e34c875fcf9603c0e967b3429ed41e792770
2022-11-15 21:16:01 +00:00
Petr Golubev
21b7c85809 deduplicate enable.numpy.pyi.stubs registry key registration
GitOrigin-RevId: 982b0b9b177839941a24d581f0587bcd65a5b8d8
2022-11-03 20:26:19 +00:00
Petr Golubev
9862779c8a move PyImportOptimizer registration to PythonPsiImpl.xml
GitOrigin-RevId: c85bf8ddc9dad1fdfcdc03d26aa391b162c97587
2022-11-03 20:26:14 +00:00
Petr Golubev
b461792bc2 register PythonCommenter in the module where it's defined (python.psi.impl)
GitOrigin-RevId: b6c84e51058da5a78b9ae8270b682006b98e1950
2022-11-03 20:26:01 +00:00
andrey.matveev
d0e0488fe6 PY-40797 Fix problem with inline string to f-string
GitOrigin-RevId: dbc2206fa2338e2b6a2552a0ca76cb4064425505
2022-11-03 17:30:23 +00:00
Petr Golubev
68f080743c move python formatter extensions to python.psi.impl module
GitOrigin-RevId: 452346cbd12e9c21c636dc8dbcab9a29813bc67b
2022-11-03 14:27:33 +00:00
andrey.matveev
cad1138e59 PY-53104 Support PEP 673 typing.Self type
GitOrigin-RevId: 8efc65725580510dc3e9a93e1242e1a69032c8f1
2022-10-19 09:45:15 +00:00
Irina.Fediaeva
cb8edc622b PY-33341, PY-56416, PY-28900: Render attributes and init params description in the class documentation
PY-33341: Now we render the “Attributes” section in the class documentation, it also allows to describe inherited attributes. (Previously we didn’t render it at all)
PY-56416: In the attribute documentation popup we are able to render attribute description from class docstring. (Previously we took documentation only explicitly from attribute one-line docstring)
PY-33341: We render the “Parameters” section in the class documentation for init parameters, described in the class docstring. (Previously user couldn't use class docstring to describe init parameters)
PY-28900: For the init parameter documentation we take the description from the class docstring if init doesn't have its own docstring. (Previously we took parameter description only from init docstring)

GitOrigin-RevId: d67bf49c72cf7a3634805a6e310c943f1ea848d1
2022-10-07 14:42:01 +00:00
Pavel Karateev
a47cf9f44e PY-55920 Suggest python-slugify for installation
GitOrigin-RevId: 0ef316336587d73cd2b79f6862635900ecde5fa6
2022-09-05 20:03:33 +00:00
Mikhail Golubev
59e79c3c7c PY-54503 Provide the result type for Enum[...].value and Enum(...).value
Precise types can be inferred only over AST if it's accessible.

I had to move PyStdlibTypeProvider higher in the provider's hierarchy
so that it could override types coming from Typeshed, otherwise we
infer enum.property type for the "value" attribute.

GitOrigin-RevId: 8727e080cfc06d0edda13eccfd601601dc661da9
2022-09-02 20:51:03 +00:00
Mikhail Golubev
84c48c48a9 PY-47532 Support new API and namespace of "attrs" package
GitOrigin-RevId: a8a0f909b21cc9f3b95a7b823452599374a943a9
2022-08-18 16:13:12 +00:00
Daniil Kalinin
f0687cf116 PY-54540 No error when ClassVar contains type variables
Inspection that checks if ClassVar contains type variables which is not allowed

Tests for it

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

GitOrigin-RevId: 0fcf81aca7416c04488cf389aba107588561554d
2022-07-26 12:16:31 +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
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
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
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
andrey.matveev
a66dea2997 PY-50401 Impl checking name argument in ParamSpec
GitOrigin-RevId: 655026dceea03b1697e5d39ce897f2ef1f25948c
2022-05-06 12:15:27 +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
Alexey Kudravtsev
9d58c2ab19 fix non-latin symbols inadvertently mixed up with latin
GitOrigin-RevId: 13beb89a6bd42b5fa69aab57862236867d3eaf61
2022-04-06 11:05:48 +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
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
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
Lada Gagina
72772c55da PY-46661 PY-43387 TypedDict type-checking in call expressions: report value type errors, missing and extra keys
GitOrigin-RevId: ad8c2e37cf893e50aeda7a54d113dec571b0d135
2022-02-10 23:02:25 +00:00
Lada Gagina
bc28fa5645 PY-46661 PY-43387 TypedDict type-checking in target expressions: report value type errors, missing and extra keys
GitOrigin-RevId: 9636c8e032f9d084d7a5c3a8036e54422b8dd222
2022-02-10 23:02:21 +00:00
Dmitry Trofimov
f35438983c CodeServer: support Python inline variable and inline method refactorings
Also decouple BaseRefacgoringProcessor from UI and split usageView into api and impl parts

GitOrigin-RevId: c4c6d9011726d93f0ee6ab4677f7a105c28ec108
2022-02-08 13:31:12 +00:00
Dmitry Trofimov
6cfea6e0b5 CodeServer: Python extract method refactoring, also decouple platform Rename refactoring from UI and lang modules
GitOrigin-RevId: fbe188a96f7eeaa168d6acf2874b1b759b9d8791
2022-02-01 19:19:46 +00:00
Dmitry Trofimov
a9a116522a CodeServer: Python introduce variable refactoring
GitOrigin-RevId: 9404442216786c92508c4a8f4bece96013683083
2022-01-24 19:34:17 +00:00
andrey.matveev
3ae3780538 PY-26881 Fix getLocationString messages
GitOrigin-RevId: 42a5a38b321e8611b9eb466a8cec675cb430cbd1
2022-01-24 05:57:47 +00:00