Commit Graph

62 Commits

Author SHA1 Message Date
Nikolay Chashnikov
3a8344fcad [plugin model] use 'public' visibility for content modules which classes are used from external plugins (IJPL-207059)
153 modules which contain classes used from external plugins from the Marketplace are marked as public. This is needed to ensure that it'll be possible to use that API after converting code from these external plugins to content modules.

GitOrigin-RevId: dc48e8970041fddd3bf50d280711e95ce9e9ad9b
2025-10-08 18:39:06 +00:00
Vladimir Krivosheev
4b619431c2 IJ-MR-175479 IJ-CR-146078 IJPL-209476 fast-util
GitOrigin-RevId: 87af2a3aad6e264a9b332c20ff572ec735f741f2
2025-10-06 16:34:02 +00:00
Vladimir Krivosheev
9f425c84ea IJ-MR-175479 IJ-CR-146078 IJPL-209476 guava as product module (part 2)
GitOrigin-RevId: 22ee846c39d44cd481ad55d11889ff43ad3b389a
2025-10-04 19:03:47 +00:00
Ilia Kirianovskii
f43aa95086 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 98a67396a48bddc3d084cc93c50ae2f2017bfe8c
2025-09-29 00:11:15 +00:00
Andrey Vokin
f8bcdc12c5 [python] make buildSubBlock and getChildIndent methods protected
It was asked for the Snakemake dialect

GitOrigin-RevId: 4af5fda0908669c5ad8fee523f018502592b45a8
2025-08-27 11:49:12 +00:00
Ilia Kirianovskii
dc268560b6 [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 275260ab73f59d3c08f0b4cb9f4c89b74054094a
2025-08-20 08:49:22 +00:00
Petr
138020a17f [python] Move PyKeywordHighlightingAnnotator registration to the module where the class is defined
GitOrigin-RevId: bdee727fbc0806fbb37b28cc9c8f87533dfe4be8
2025-07-16 17:37:52 +00:00
Petr
6c6af5e129 PY-71549 Move numeric literal validation from PyKeywordHighlightingAnnotator
It also caused double highlighting on the frontend as PyKeywordHighlightingAnnotator is currently registered in both frontend and backend.

GitOrigin-RevId: 1f653d1d259fb8ca6b5471b6cd0d2974f62b4fae
2025-07-15 11:17:13 +00:00
Petr
2402957c9d PY-71549 Move async-related check from PyKeywordHighlightingAnnotator to PyAsyncAwaitAnnotatorVisitor
It also caused double highlighting on the frontend as PyKeywordHighlightingAnnotator is currently registered in both frontend and backend.

GitOrigin-RevId: cdf111acfdb8a979613007e12abcf6c7dac9c9dd
2025-07-15 11:17:13 +00:00
Petr
efc364c13f PY-71549 Move None, True and False rehighlighting from PyHighlightingAnnotatorVisitor to PyKeywordHighlightingAnnotator
GitOrigin-RevId: 4ca534b964d02236ad688fd8446cd963d647e350
2025-07-15 11:17:13 +00:00
Petr
3e1cf2afd5 PY-71549 Rename PyHighlightingAnnotator -> PyKeywordHighlightingAnnotator
GitOrigin-RevId: 1bf5c7c8cb3c074b2875d309d471840401665e84
2025-07-15 11:17:13 +00:00
Petr
a51b604bd4 PY-71549 Eliminate global shared state inside annotators
Before, when entering an `annotate` method, a reference to `AnnotationHolder` was stored in the annotator field. And this required synchronization. Now this reference is stored into a temporary PyElementVisitor object actually used to perform highlighting.

Also, register all python annotators using a regular 'annotator' EP. There is no point in using 'Pythonid.pyAnnotator'.

GitOrigin-RevId: ad1df8ce743bc62d3f43e6bf9b1a8ea370ff7de7
2025-07-15 11:17:12 +00:00
Alexey Kudravtsev
d4567533d6 codestyle cleanup: notnull
GitOrigin-RevId: 525875990920936a8dfd6a9eb1ef47c896194899
2025-07-09 16:56:19 +00:00
Petr
31c71642fd PY-81471 Move PyLineWrapPositionStrategy to python.syntax.core
GitOrigin-RevId: 998a62f09ee1e2fed512c5ae8c8cfed8808c947f
2025-06-13 20:21:12 +00:00
Petr
e7a8716848 PY-81471 Move PythonCommenter to python.syntax.core
GitOrigin-RevId: a4d6c426f104f67c0bf95b15b321c101590c5142
2025-06-13 20:21:12 +00:00
Morgan Bartholomew
4b1d24562a [python] PY-80436 support ellipsis
GitOrigin-RevId: 82e38fcb502ed68d5676f2cc774ef2653d69febb
2025-05-29 01:00:27 +00:00
Vladimir Krivosheev
5b7e72ee8a cleanup
GitOrigin-RevId: c1b463c720414d421a507729c9d8e33ce961b7da
2025-05-20 20:56:36 +00:00
Alexey Kudravtsev
6d1f55f160 cleanup: rename file to psiFile to distinguish from VirtualFile
GitOrigin-RevId: e718eac8ba2d2177787ae941d8525b3c154d10fc
2025-05-16 02:54:06 +00:00
Petr
c8fb196d52 PY-76877 Conformance test failure: overloads_basic.py
PySliceExpression is replaced by PySubscriptionExpression in AST.
PySliceItem is returned by PySubscriptionExpression.getIndexExpression(). For that purpose PySliceItem is now a PyExpression of type `builtins.slice`.

GitOrigin-RevId: 9aa8de13ef7c51741e248317c5264b3a06ffb9bf
2025-05-12 18:15:13 +00:00
Ilia Zakoulov
86334df8ad PY-77360: Create module-level docstring if it is not there
GitOrigin-RevId: 840b9d7ca76db288184d0b8e33a833d65fd97948
2025-05-12 16:40:22 +00:00
Vladimir.Koshelev
67594cdaad [pycharm] finish community migration to v2
# Conflicts:
#	community/python/pluginCore/resources/META-INF/plugin.xml

GitOrigin-RevId: e4d6969fd15a3fddc4d6a03491fb9f9634285edf
2025-04-30 10:08:56 +00:00
Daniil Kalinin
97ba49d547 PY-26877 Support adding trailing commas to multiline collections, argument and parameter lists
Merge-request: IJ-MR-153633
Merged-by: Daniil Kalinin <Daniil.Kalinin@jetbrains.com>

GitOrigin-RevId: b304977e30eb4b378d858fcc5300846dc5965445
2025-02-14 08:46:05 +00:00
Daniil Kalinin
89c82d66c2 PY-31689 Correctly insert space after comma and collection closing brackets
GitOrigin-RevId: ac972f3028f840b6bb073f28521031df5d5a8635
2025-02-13 10:45:38 +00:00
Daniil Kalinin
fddb487bf8 PY-31689 Do not wrap tuples and list literals inside subscription expressions
GitOrigin-RevId: 9878660c10bab6bda36aa5f2bcd4c96f416dddb8
2025-02-13 10:45:38 +00:00
Daniil Kalinin
5b0b94a8dd [python] Formatter: Make sure that comments in collections are not placed on the new line on wrap
* Extract getting wrapping for collections and arg/param lists into a separate method
* Add a test

GitOrigin-RevId: 7ac252e5ab414329951adc61ea0dd29beeb27c04
2025-02-13 10:45:38 +00:00
Daniil Kalinin
2d7ad0e1fb PY-31689 Support wrapping options for parenthesized tuples
GitOrigin-RevId: 2b14686ea8c691627c9a8155f75a7c6727a48bf3
2025-02-13 10:45:38 +00:00
Daniil Kalinin
b1b0a08fbc PY-31689 Support wrapping options for set literals
GitOrigin-RevId: 6f76a929da4bde150339ab924f4e84f91d70d8a3
2025-02-13 10:45:38 +00:00
Daniil Kalinin
f8a57f7367 [Python] Refactor the old DictAlignment enum which prevented dynamic syntax bundle loading
Unfortunately, we need to keep the old int values logic to preserve compatibility with old user settings

GitOrigin-RevId: 59fba8bd53e3d89d31897ed675b54827bbf9b15f
2025-02-13 10:45:38 +00:00
Daniil Kalinin
a4f9be714a PY-31689 replace deprecated wrap options declarations with new ones
GitOrigin-RevId: ab9881ef097c6aac6220ae401ee1fa0d9620446f
2025-02-13 10:45:38 +00:00
Daniil Kalinin
f9a1e44638 PY-31689 Support wrapping options for list literals
GitOrigin-RevId: be976ddc224983174f5566e53985e29fd49051f4
2025-02-13 10:45:38 +00:00
Leonid Shalupov
5db4998301 housekeeping: remove unused imports
GitOrigin-RevId: be93bd341860bfc077fdbff5ce2ae91eebada31e
2025-02-11 23:18:34 +00:00
Vladimir Krivosheev
c3c21baac5 update bazel files
GitOrigin-RevId: 1a10e8174a47f688a95a93af0540f722462acd97
2025-02-03 11:42:18 +00:00
Daniil Ovchinnikov
dea8eddb0c rename intellij.platform.editor -> intellij.platform.editor.ui
GitOrigin-RevId: f4aa008b77368945ce9651fdc47f9463e3445347
2025-02-02 16:22:43 +00:00
Daniil Kalinin
31d7aa1a6c PY-32711 Reformat simple injected code fragments with the corresponding language formatter
* Add `PyFormattableInjectedBlock` entity which allows passing the code inside the injection to the formatter of the injection language (e.g., SQL)
* Add code style options to enable and disable this behavior
* Add tests

GitOrigin-RevId: b63ff37d8aab3e37d101be3d0cc9e7ff0897b5a1
2025-01-21 15:47:46 +00:00
Vladimir Krivosheev
0bc1cf1557 update bazel files
GitOrigin-RevId: 7320d3eff3aba093692ce66839c720ece6d7c4db
2024-12-30 11:28:24 +00:00
Vladimir Krivosheev
7b9ec58009 do not export intellij.database.connectivity.tests
GitOrigin-RevId: a1ef44dfa34cde110c9e6cad19d11b5e3019ab72
2024-12-28 21:45:55 +00:00
Vladimir Krivosheev
25233df1b1 cleanup - isEmpty
GitOrigin-RevId: 100d69abb6a423556574a72e82508fdb8f5d7fa3
2024-12-27 14:41:14 +00:00
Vladimir Krivosheev
68d99c6550 cleanup
GitOrigin-RevId: 9cb238c220249088bfc75a448eb310b93c7fc45c
2024-12-26 14:56:01 +00:00
Vladimir Krivosheev
98799639aa do not use _test as lib - test targets do not support this
GitOrigin-RevId: f2f49db4294b6a64040dbbd5f1d95e972cbd70a3
2024-12-15 18:32:30 +00:00
Tagir Valeev
5dca817b05 Add missing @Override annotations
GitOrigin-RevId: 56b084f82d4f4ec5153645b4d745bc881b803a26
2024-11-29 12:51:16 +00:00
Vladimir Krivosheev
17916c90f8 libraries -> lib, resources, opt-in, test deps
GitOrigin-RevId: db66ee95dcb0f0553b40c9cc56cd6afed8634cdd
2024-11-27 13:53:42 +00:00
Tagir Valeev
1a4a0b51b3 Warnings fixed (mostly redundant assignment)
GitOrigin-RevId: 79b9c2ae99e8afc7b1f49e8cea2b31745458404d
2024-11-26 10:10:48 +00:00
Alexander Kuklev
b076ea2794 [PY-33917] Now '__init_subclass__' is treated as and constructor-like method in appropriate cases
GitOrigin-RevId: c2ac58960f641868006141ae3001c932c6a8eaaf
2024-11-22 20:44:45 +00:00
Irina Fediaeva
3641c5fbef PY-52574: Remove Epytext docstring format & Py2 docstring rendering
Docstring rendering is no longer supported for Python 2, which became obsolete after reaching its end of life in 2020. Without updates or security patches, most tools, including documentation generators like Epydoc, have shifted focus exclusively to Python 3.

GitOrigin-RevId: ace78ac9ad943278449d5b20bb92db9f7571b5b5
2024-10-29 21:03:06 +00:00
Mikhail Golubev
58d00407db PY-77060 Remove spaces after * and ** in new-style PEP 695 type parameters
GitOrigin-RevId: cd38f49d0f28894e4f33dbd2fa331eaf895fd70d
2024-10-29 13:37:39 +00:00
Petr
93b9066edf PY-34617 Support version check
GitOrigin-RevId: 3318ff79cdcc5ba0ce5e4feb65abad5ad0f4acfa
2024-07-28 00:24:15 +00:00
Petr
16a7fb4b3e PY-34617 Move getTopLevelAttributes(), findTopLevelAttribute() from PyAstFile
GitOrigin-RevId: 226a7e968851ab0c8730bb79ca90d0ed5dcec364
2024-07-28 00:24:15 +00:00
Vladimir Koshelev
ec8c3a8aa3 [pycharm] remdev: migrate PyCharm Frontend launcher to v2 modules
GitOrigin-RevId: e2c62c23bd0a22c742a46177c1a1ad4c4b5b95d0
2024-07-24 13:13:53 +00:00
Mikhail Golubev
52850e21d8 PY-62208 Include importable names in basic completion results
Previously, such names were visible only on so-called "extended" completion,
activated when the hotkey for the basic completion was hit twice. The main reason
was that collecting such variants from indexes was a slow process, and we
didn't want to harm the responsiveness of completion for basic names.
Now it becomes possible thanks to a number of performance optimizations:

* Instead of using three separate indexes for classes, functions and variables,
we use one -- PyExportedModuleAttributeIndex. By definition, it includes only top-level
"importable" names, so we additionally save time by not filtering out irrelevant
entries. Also, it doesn't contain private definitions starting with an underscore.
It might bother some users, but given that the previous completion was used
extremely rarely, and the new one is going to be visible everywhere, it seems
that pruning unlikely entries as much as possible is a fare tradeoff. In the future,
we might enable them back on the "extended" completion if there is a demand.
Also, this index binds its keys to the project (`traceKeyHashToVirtualFileMapping`),
further eliminating useless index lookups.

* Thanks to the recent fixes in the platform (IJPL-265), it's now possible to
simultaneously iterate over all keys in an index and request values for a given key
without deadlocks, which is much faster than eagerly fetching all keys first.

* While scanning through all matching entries from indexes, we terminate
the lookup if the number of items exceeds the size of the lookup list.
We can further reduce this number by adjusting the "ide.completion.variant.limit"
registry value.

* Calculating expensive "canonical" import paths (e.g. "pkg.private.Name" is importable as
"pkg.Name") is offloaded to a background thread thanks to the `withExpensiveRenderer` API.
We still calculate these paths synchronously, though, for names whose raw qualified names
contain components starting with an underscore to decide whether these private names are
publicly re-exported and, hence, should be displayed.

The rest of the work has been put into reducing the number of entries on the list, e.g.

* The prefix under caret is now matched from the beginning of a name, e.g. `Bar<caret>`
matches `BarBaz`, but not `FooBar`.
* We don't suggest imported names clashing with those already available in scope.
* Some kinds of definitions are not suggested in specific contexts, e.g.
functions and variables are not suggested inside patterns and type hints.
* Nothing is suggested at the top-level of a class body, where dangling
reference expressions or calls are not normally expected.

Additionally, we don't suggest names from .pyi stubs at the moment, because
it pollutes the suggestion list with entries coming from the stubs for
third-party packages in Typeshed. We should probably enable them back once
we are able to properly disable Typeshed entries for not installed packages.

Some legacy forms of completion are left in the extended mode. In particular,
qualified names of classes are offered inside string literals only in this mode.
Also, module and package names are suggested only in the extended mode, because
top-level packages and modules are already suggested for the basic completion
by PyModuleNameCompletionContributor.

A few tests in PyClassNameCompletionTest were updated or removed entirely because
* we no longer suggest private names
* we no longer suggest names from private modules not re-exported in a public module
* we no longer suggest names clashing with those already available in scope
* prefix matching policy was changed to start at the beginning of an identifier

The whole feature can be disabled with the option "Suggest importable classes,
functions and variables in basic completion" in settings.

GitOrigin-RevId: 0787d42ce337b73b01a60f0bb7aa434fee43e659
2024-07-02 14:08:48 +00:00
Daniil Ovchinnikov
07f7cdaf55 IJPL-1044 wrap clinit instance requests in non-cancellable section
GitOrigin-RevId: f63849ca504a01dbae51faac27f29e69f43bff86
2024-06-25 20:12:17 +00:00