Commit Graph

28261 Commits

Author SHA1 Message Date
Mikhail Golubev
0d34a0e88f PY-59594 PEP 701: Make the intention for flipping string quotes aware of the syntax
(cherry picked from commit a62f78cfdee24eccf3fcf2d341807565f26d2fbd)

IJ-MR-115763

GitOrigin-RevId: 059a289a9006d592a88a677137647c0660c68fc2
2023-09-29 09:33:49 +00:00
Mikhail Golubev
b3351b941e PY-59594 PEP 701: Stop recovery of incomplete f-string fragments at statement-only keywords
(cherry picked from commit 7aa912a43d63f6c9867d772e120c5b45adb10be3)

IJ-MR-115763

GitOrigin-RevId: ca6909a8e7a59e06eae69b631160e4d48541ce58
2023-09-29 09:33:45 +00:00
Mikhail Golubev
37d25ee815 PY-59594 PEP 701: Allow quote-reuse and line breaks inside f-strings. Keep reporting these problems for Python <3.12.
PEP 498 required f-strings to be recognizable by existing tooling, such as syntax highlighters,
by prohibiting re-using quotes of the same kind and having line breaks inside expression fragments.
We used to detect these problems already at the lexer level, correctly replacing violating quotes
with FSTRING_END token, and appending STATEMENT_BREAK tokens to illegal line breaks inside expressions,
depending on the lexer's state. Now, thanks to a general f-string grammar in PEP 701, most of this
bookkeeping could be moved from the lexer to the CompatibilityVisitor (to still be reported
for previous versions of the language and by the compatibility inspection).

Previously forbidden backslashes and line comments are now also detected by the CompatibilityVisitor
instead of the version-agnostic FStringAnnotator.

One side effect of the new grammar is that parser recovery in pre-3.12 version of Python became
slightly worse. For instance, something like `f'{foo'` used to be recognized as an f-string
with an incomplete fragment lacking its closing brace. Now, it's parsed as an incomplete
f-string, lacking its own closing quote, containing an incomplete string literal inside
an incomplete fragment. What's more, parsing of this fragment's expression doesn't terminate
until the end of a file, because STATEMENT_BREAK is never produced by PythonIndentingProcessor
while it's inside an f-string fragment, and every quote is considered a new string literal.

Examples of parsing tests affected by this are:
PythonParsingTest.testFStringFragmentIncompleteTypeConversionBeforeClosingQuote
PythonParsingTest.testFStringIncompleteFragmentWithTypeConversion
PythonParsingTest.testFStringIncompleteFragment

I also had to simplify some scenarios from PythonHighlightingTest, removing snippets
with incomplete fragments or moving such examples to the very end of a file.

It's not clear how to handle these situations not overcomplicating the lexer.

(cherry picked from commit 03ba6d7fba1b45a84aa92221e6a452645a765205)

IJ-MR-115763

GitOrigin-RevId: cd36470d9cae353fe3caeb2d3b628d8743b46cbb
2023-09-29 09:33:42 +00:00
Nikolay Chashnikov
920129ae5a [python] API cleanup: remove unused deprecated API (IDEA-322162)
GitOrigin-RevId: 1d6fc7a553bf403921efe59267b2acb33ce3d165
2023-09-29 09:22:16 +00:00
Georgii Zorabov
c84ff3fef4 DS-5284 Added histograms to the column statistics panel.
Calculated column statistics for visualization in pandas and polars, implemented parsing in DSPyDevdTableDataProviderWithDescribe.kt, introduced getValueOccurrencesCount to store statistics for visualization.

Enabled histogram drawing for numeric and boolean columns in compact and detailed statistic panel modes in DSStatisticsTableHeader.kt, and relocated DSStatisticsHeader utility classes to DSStatisticTableHeaderUtils.kt.

Merge-request: IJ-MR-115129
Merged-by: Georgii Zorabov <georgii.zorabov@jetbrains.com>

GitOrigin-RevId: 413a950187d9fb17e1ac936198bee8d85c47347b
2023-09-28 23:05:28 +00:00
Elizaveta Shashkova
c2c8456c8a PY-41348 Add macros to script path
(cherry picked from commit c81f88827301c4ddf1da46ce81ba27ede1ed1dc0)

IJ-MR-114581

GitOrigin-RevId: 65af13dcc69ecc020de95fc9d4e8d1fc27c15562
2023-09-28 20:11:12 +00:00
Elizaveta Shashkova
a00bae893b PY-41348 Add macros to working dir
(cherry picked from commit b70585ccc7ca18a187f2349d5655c39ab7795b3b)

IJ-MR-114581

GitOrigin-RevId: 004b1c0b88d9c1090f2390adb333859ec89c4842
2023-09-28 20:11:08 +00:00
Pavel Porvatov
93bc604072 [Kotlin UI DSL] Port PyWelcomeGenerator to Kotlin UI DSL (removed deprecated API usage)
GitOrigin-RevId: cd458f844bea01d137a8e4760b10d967caace5db
2023-09-28 16:35:35 +00:00
Daniil Kalinin
9249e0a15c PY-61856 PEP 695 Type Parameter Syntax: Code compatibility inspection and unsupported features annotator
GitOrigin-RevId: 164a07daff1059ac1a421e1a883168924f82559e
2023-09-28 15:05:34 +00:00
Daniil Kalinin
97185d17c8 PY-62608 PEP 695 Type Parameter Syntax: Resolve and scoping for type parameters in type aliases
GitOrigin-RevId: be532456e7a9c470d5d0a2770a7a2eb9b9b6e8de
2023-09-28 15:05:33 +00:00
Daniil Kalinin
65cc3ddfd0 PY-61877, PY-61878 PEP 695 Type Parameter Syntax: Control flow for type parameters and type aliases
GitOrigin-RevId: 2db381cbb97891296bae09e48c17b46eefa57a04
2023-09-28 15:05:31 +00:00
Daniil Kalinin
1c5b0c5ac3 PY-62608 PEP 695 Type Parameter Syntax: PSI stubs for type parameter lists and type aliases
GitOrigin-RevId: b8707b4677519bab5bcf922c9747eb8388e3157b
2023-09-28 15:05:30 +00:00
Pavel Karateev
c94a4fea62 [python] PCQA-273 Switch from 3.12 RC2 to RC3
GitOrigin-RevId: d076158de38a25cb8fff0205b24da6dc9d534f71
2023-09-28 14:55:40 +00:00
Mikhail Golubev
a639a793c6 [python] Better failure messages for Python lexer tests
GitOrigin-RevId: d73a4cd02768912098206ea8fbc1b77973fe97db
2023-09-28 11:39:15 +00:00
Konstantin Hudyakov
b3315624bb [IFT] Refactor: extract getCallBackActionId to Utils
GitOrigin-RevId: 798a1d1aaca11f9e5c207d9ea20b01867b91eb32
2023-09-27 13:21:00 +00:00
Konstantin Hudyakov
428ce848ab [IFT] Fix parsing of the callback ID if it is greater than 999
Found that `com.intellij.AbstractBundle.getMessage` applies the formatting to the parameters passed as a `Number`. For example, it translates 1032 int to "1,032" string. And then `toInt` method fails to parse it.
Better to use String value as ID for callbacks to avoid this problem.

GitOrigin-RevId: 95a667a35f6107ec71df0da26892541d1d964b98
2023-09-27 13:20:57 +00:00
denispopesku
9de8410365 [qodana] Added support for python linter pytoml and SPDX fixes:
- fully supported spdx format for python projects

GitOrigin-RevId: f9845f81506ce708d58b921805ca7f7fb188084c
2023-09-27 12:48:22 +00:00
Andrey Vokin
02e863680e DS-5308: improve dbt init experience
GitOrigin-RevId: 43d346752cedb9d19c6bc3080f1a13c9eaf3abdf
2023-09-26 09:59:53 +00:00
Andrey Lisin
0542504ebe PY-62566 Don't use cached_property to avoid compatibility issues with earlier versions of Python
GitOrigin-RevId: fb31afc208153a3fe4b7a0e4a1590019cf749a96
2023-09-24 18:48:42 +00:00
Vladimir Krivosheev
64a4060d5a do not wait for appInfoDeferred to init app
GitOrigin-RevId: c15086f0709a9475e9001b7ae9e68aae78cbce68
2023-09-23 19:18:11 +00:00
Olga.Lavrichenko
e94ddb7777 DS-4881 Jupyter runtime completion with global variables names by prefix
GitOrigin-RevId: cc782a0ab2d0993df10a81a7782f450dc247e91e
2023-09-22 17:53:24 +00:00
Andrey Lisin
95a844f2cb PY-62566 Add experimental support of low impact debugging for Python 3.12 based on PEP 669
GitOrigin-RevId: 020a245fb44623870075e071fbba6b6c75e81d09
2023-09-22 17:26:41 +00:00
Pavel Karateev
d52b3d9b7f [python] PY-63179 Add PyCharm 2023.3 artwork
(cherry picked from commit 3954b61614e0b6f53b17daa18604d5d83f51a269)

IJ-CR-115465

GitOrigin-RevId: da7a0b004806e4cf6081bafd3043b500ab7e8da7
2023-09-22 15:51:11 +00:00
lada.gagina
ea722bc187 [python] Use virtualenv 20.13.0 for python <= 3.6 (PY-61694)
GitOrigin-RevId: 9b0ef4e9c50a5479510bba7d4b5ce7b9865d3e50
2023-09-22 15:37:37 +00:00
lada.gagina
2654b58d90 [python] Do not require setuptools for python >= 3.12 (PY-61694)
GitOrigin-RevId: c0513bcb343dcdc6f2d14dd50140ee58453daa8b
2023-09-22 15:37:35 +00:00
Aleksey Pivovarov
5b1217b236 python: do not try to serialize Sdk in run configuration
Fix 'Binding - no accessors for com.intellij.openapi.projectRoots.Sdk' warnings

GitOrigin-RevId: 793dad666a6763938ad0253e8010e3b48db92275
2023-09-22 12:29:17 +00:00
Daniil Ovchinnikov
c973850ddc IJPL-255 replace Application.assertIsDispatchThread -> ThreadingAssertions.assertEventDispatchThread
GitOrigin-RevId: da80a0648ffce76e93f35f72afc93334b21fe9a2
2023-09-22 00:08:26 +00:00
Gregory.Shrago
ce0e6ff6d8 reuse ConfigurationContext when building tooltip
GitOrigin-RevId: e7513e4f848ba186d4751ce7df5cfb3265d54d52
2023-09-21 12:32:57 +00:00
Konstantin Bulenkov
5754f148cb update icns icons IDEA-256202
GitOrigin-RevId: 00f76a73f93c76b473f61bf854980876b1764301
2023-09-20 15:08:29 +00:00
Andrey Lisin
f2b4812360 PY-59015 Compatibility with Python 3.12 after deprecation of distutils package
GitOrigin-RevId: 0fc04d628d85a1d4f0fc3437b1304ba82677ddc4
2023-09-20 13:34:37 +00:00
lada.gagina
96e8fb5dbc [python] Use importlib.metadata instead of the deprecated pkg_resources to introspect installed packages (PY-61694)
Also update bundled virtualenv 20.16.7 -> 20.24.5

GitOrigin-RevId: 121669933ae55a54ac8cc49fe9f5e57080bbd2a6
2023-09-20 09:32:51 +00:00
Anton Bragin
847d836c5b DS-2556 Data frame opening from variable view and debugger fixed
GitOrigin-RevId: 177640267ce23debe471beab1a3eeb090ad460d4
2023-09-19 22:04:19 +00:00
Ilia Zakoulov
fbbf66341b PY-62513: Implement obtaining all properties from class and its superclasses
GitOrigin-RevId: 6b531affdde601bce7660ddb7f2fbb7f85998050
2023-09-19 16:17:54 +00:00
Vladimir Koshelev
60090602b4 [python] treat as bool type guards in return types PY-62476
GitOrigin-RevId: 0b59fd99aeaece087837858fb13376370d0d225b
2023-09-19 12:11:20 +00:00
Nikolay Chashnikov
1410343ce4 [pycharm] refactoring: override ExternalProductResourceUrls service instead of specifying URLs in ApplicationInfo.xml files (IJPL-204)
GitOrigin-RevId: 34b48c0f4ec0f4bf6329b672dd2eaf450f331ea7
2023-09-19 09:57:47 +00:00
Nikolay Chashnikov
c70038394f [pycharm] refactoring: move files from ideCoreSrc to ide-common/resources (IJPL-204)
It's confusing to have a directory named *Src which is marked as a resource root. Also, we need to add a real source root to intellij.pycharm.community module to store an implementation of ExternalProductResourceUrls in it (IJPL-204).

GitOrigin-RevId: cf140b320d40b9357177035b98bc0fc0fe6c5854
2023-09-19 09:57:43 +00:00
Vladislav
bbc7164ab9 RUST-11915 Show python interpreter settings in RustRover
Similar to d05cbf7f49
 + c78b497938044009238095bdbf8fba913215d1d2

GitOrigin-RevId: cd86586528e084650db78f4d19e28eec76c5dc34
2023-09-19 03:45:16 +00:00
Vladimir Koshelev
075ee07e2c [python] fix parameter info performance issues with boto3 PY-63153
GitOrigin-RevId: 1cbac99533c2b8d7780f7fbb88879063ddde413c
2023-09-17 19:15:31 +00:00
Vladimir Krivosheev
b67de4a4b0 IJPL-238 remove the unnecessary usage of commons-lang library (part 3)
GitOrigin-RevId: dec81af8deb5d9b396e9150538bdca1d951b1d80
2023-09-15 20:50:02 +00:00
Vladimir Krivosheev
030ff97b71 IJPL-238 remove the unnecessary usage of commons-lang library
GitOrigin-RevId: c513ea78426bccd540dc1d8144466fd61e8727f3
2023-09-15 20:49:59 +00:00
Vladimir Krivosheev
818b0b7776 IJPL-238 Remove unnecessary library "commons-collections"
Removed the "commons-collections" library across multiple modules as it is no longer needed. This clean up helps streamline dependencies and reduce project complexity.

GitOrigin-RevId: 3763cf649644d8782e03b7419d780e245c5f3eef
2023-09-15 20:49:53 +00:00
Daniil Kalinin
3a70f1d22d PY-61854 PEP 695 Type Parameter Syntax: Formatting
GitOrigin-RevId: 272f956033d82626d7cf689aa561cdeab3f951da
2023-09-15 16:04:46 +00:00
Daniil Kalinin
4b6848cb9f PY-61855 PEP 695 Type Parameter Syntax: Highlighting
GitOrigin-RevId: 498ab5e3a697c2eb616ae3d0820f99c480596306
2023-09-15 16:04:43 +00:00
Daniil Kalinin
8b217ed53a PY-61853 PEP 695 Type Parameter Syntax: Parsing
GitOrigin-RevId: 286b53bb4e69cf1deb58dc75f41652e6a12a3af3
2023-09-15 16:04:41 +00:00
Daniil Kalinin
067452815f PY-20861 Python support with the Move Element Left/Right feature
Merge-request: IJ-MR-111447
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: a4fbe9d1a8634a7ad8f0893266e26738be993cea
2023-09-15 11:11:04 +00:00
Egor.Eliseev
56985b7713 PY-63114 Add virtual file to the Python Console editor
Merge-request: IJ-MR-114928
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: fc55c5edad40e8c2eb47e69d2b4382982c4ca35b
2023-09-14 14:36:12 +00:00
Pavel Karateev
6c891e05ab [python] PCQA-247 Run env tests on 3.12.0rc2
3.12.0rc2 is already available for `pyenv`
so there is no need to limit 3.12 tests with Windows

GitOrigin-RevId: 68cca5bb2ff93a4015111bf9263433ffd33239f4
2023-09-13 13:17:43 +00:00
Vyacheslav Moklev
488cd0c699 [RDCT] Wrap runnable in PythonRunner with ClientId
If not wrapped, if you start a run configuration from client, Run tool window will be opened only on Host.

GitOrigin-RevId: 4bf3b77e1f79a554eb26446d155c7aa316d53c4b
2023-09-13 11:37:54 +00:00
Olga.Lavrichenko
c9b1045a46 DS-5427 DS-5549 Fixed parsing magic commands after empty cells
GitOrigin-RevId: d2359bacd7f772ebeaaabe7d1d43da060d2f7928
2023-09-12 13:48:51 +00:00
Georgii Zorabov
de2f2bac64 [DS-2562] created test and changed canSortTogether, so it is not taking a grid as a parameter
[DS-2562] removed polars tests

[DS-2562] split polars and pandas into different files and made tables fixtures

[DS-2562] added checks that generated commands actually work in Python

[DS-2562] changed function name

[DS-2562] moved tests into proper directory

[DS-2562] specified return type in createAscSortKeys

[DS-2562] removed duplications

[DS-2562] renamed tests and test file, added blank lines

[DS-2562] fixed naming in tests

[DS-2562] fixed caption to getSortCommand method

[DS-2562] deleted unused imports

[DS-2562] fixed tests

[DS-2562] fixed test for checking that command is generated properly

[DS-2562] refactored code and added test for checking that command is generated properly

[DS-2562] fixed comments

[DS-2562] added proper disposing

[DS-2562] fixed formatting

[DS-2562] fixed naming

[DS-2562] removed redundant dependencies

[DS-2562] removed unintentional formatting changed

[DS-2562] deleted changes in canSortTogether, fixed SortingTest

[DS-2562] created test and changed canSortTogether, so it is not taking a grid as a parameter


Merge-request: IJ-MR-113863
Merged-by: Georgii Zorabov <georgii.zorabov@jetbrains.com>

GitOrigin-RevId: 297e5b2f880fe8ac577b8704d24365256305ff1d
2023-09-12 10:38:21 +00:00