Commit Graph

29333 Commits

Author SHA1 Message Date
Ilya.Kazakevich
9f06f1a251 PY-71747: Do not fail if remote interpreter has a path with ssh:// prefix.
Some remote interpreters have `sdk#homePath` starting with `ssh://`.

Code all over the monorepo assumes that `homePath` is a local file path and tries to convert it to `Path` throwing the exception effectively.

There is a `isCustomPythonSdkHomePath` which must be used to check string before trying to convert it into `Path`

The current situation (along with "solution") is a legacy from dark ages and will be rewritten to the workspace model soon

GitOrigin-RevId: 9adc02f312667571a65ff63d4e802aa7d6dbb518
2024-05-02 14:20:44 +00:00
Ilya.Kazakevich
82f83b2945 PY-71792: Partially reverted d0fdbb16c33f14dc6aee446a3f42c0cfcd4d0b19
It turned out that `complete` might throw some exceptions. Some of them ought to be shown to user, so we got back to this excellent error processing approach.

GitOrigin-RevId: 2152cca9ddafe8d75d980347196ccf6eaf276533
2024-05-02 14:20:40 +00:00
Nikolay Chashnikov
42b2cd3e14 mark members used from other modules as public and add @ApiStatus.Internal annotation to them instead (IJPL-149126)
This is needed to avoid 'IllegalAccessError' if different modules are loaded by different classloaders.

GitOrigin-RevId: 99113e2a8bee471332174bd2710eccf9b47ebb67
2024-05-02 08:45:51 +00:00
Nikolay Chashnikov
c39556d80e [python] add special access method to PyPackageManager to avoid incorrect usage of protected methods (IJPL-149126)
'getSdk' and 'shouldSubscribeToLocalChanges' were called not from a subclass, so they were actually used via 'package private' visibility. And this will fail with IllegalAccessError if intellij.python.community and intellij.python.community.impl are loaded by different classloaders.

GitOrigin-RevId: 6e2f779063ae9fc188b60b3d52bb5cbe6fe496a9
2024-05-02 08:45:44 +00:00
Nikolay Chashnikov
e9671e99c7 cleanup: move TestEnv out from com.jetbrains package
It would be better not to place any classes in such a generic package. And it also causes red code due to IDEA-352819, so this needs to be fixed to allow enabling "Good code is red" inspection in "Zero Tolerance" checks.

GitOrigin-RevId: d0edae5ceda7e95fe3b2b9726e5c3996ded149ca
2024-05-02 08:45:06 +00:00
Nikolay Chashnikov
b4df0488a0 cleanup: don't use private class in signature of CustomFoldingSurroundDescriptor.getAllSurrounders
This is needed to work around for IDEA-352818 to allow enabling "Good code is red" inspection in "Zero Tolerance" checks.

GitOrigin-RevId: a058e15624e39c3faa649df20bd4f7c20be5faaf
2024-05-02 08:45:01 +00:00
Andrey Lisin
705043e00a PY-72239 Reenable Python 3.11 and 3.12 for stepping tests where they were previously disabled
GitOrigin-RevId: 644639857cb6be26ddac76615f68c0718f05be58
2024-05-01 13:59:37 +00:00
Andrey Vokin
60aa7ae2d3 PY-71972 "Go to declaration or Usages" doesn't work for instance fields from the constructor.
TextOffset is used to retrieve target element here: TargetElementUtilBase#getNamedElement.

GitOrigin-RevId: 5c9d721e6870079e4bf86ab7e5c8efb0be5810b0
2024-04-30 16:17:53 +00:00
Egor.Eliseev
6c926e9a53 PY-35986 Allow a user to run doctests with pytest
Fix failed test
Fix doctest rerun test action
Small refactoring


Merge-request: IJ-MR-131720
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 355ea19b6f055ad501a34ce27b1f7f5438fa6dc1
2024-04-29 22:04:26 +00:00
Andrey Lisin
5537341b76 PY-72239 Fix Python 2.7 smart stepping for some cases
GitOrigin-RevId: c2baa98e4514fec5e3b9a034b61a5ca3e1d2eb5d
2024-04-29 20:00:32 +00:00
Vladimir Krivosheev
3efe3553ff IJPL-148294 mark classes as internal, fix IntelliJProjectPackageNamesTest
GitOrigin-RevId: b8848d23cb161f066a3737e051087aa1272554e1
2024-04-29 15:46:03 +00:00
Petr
11549ca709 PY-42664 fixed dictionary type inference
GitOrigin-RevId: 3fd967d00a6212769001166975167f022288f787
2024-04-26 20:12:18 +00:00
Petr
c58f577ee8 PY-42664 Code deduplication (PyCollectionTypeUtil)
GitOrigin-RevId: cde6db9b023b33fc5955ed16ae465e00bb6a5160
2024-04-26 20:12:18 +00:00
Vladimir Lagunov
d3d8287e5c Fix PipPackageManagerWslTest: provide blockingContext in PythonPackageManagerExt
GitOrigin-RevId: 4a8f66bce34a18e3a81fa19ce5b1d9954e468495
2024-04-26 18:27:38 +00:00
lada.gagina
f9aadb03b9 [pycharm] PY-65265 Handle geopandas.GeoSeries objects when displayed as series
GitOrigin-RevId: 77028bc8f4dd5ba1689cd379016cf9a7249bb117
2024-04-26 16:00:46 +00:00
Aleksei Kniazev
1617cde94c [python] fixed package installation from Python Packages toolwindow (PY-72237, PY-71877)
Possibility to set full version string from requirements.txt resulted in incomplete installation command being passed to pip or incorrect specification being passed to CondaPackageManager for method calls that rely on default values of parameters.

GitOrigin-RevId: a44d3c20dc3a8dac0e5ca67479be05a72b821b1a
2024-04-26 02:37:38 +00:00
Petr
68c421f3d9 PY-42738 Incomplete handling of single and double quotes for dictionary keys in auto completion
GitOrigin-RevId: ed480e40c4de292d38efbe59656cf3c8eb234435
2024-04-25 23:00:28 +00:00
Petr
2409f9f494 [python] Reduce code duplication in PythonCommonCompletionTest
GitOrigin-RevId: 1e39bed5d00d3253907dc0d8cedbd37d323a9859
2024-04-25 23:00:28 +00:00
Elena Shaverdova
440989e665 Deprecate unused FileBasedIndex.isIndexAccessDuringDumbModeEnabled
GitOrigin-RevId: 26cfedfbb09fff333ae695a045c88f319ce44971
2024-04-24 21:55:17 +00:00
Alexey Kudravtsev
ddf9b3da94 assertion: Language constructor must be non-public to avoid creating Language duplicates + test
GitOrigin-RevId: eb6954f444bf64bbc1d47b419af5e4db6fadf07e
2024-04-24 14:06:20 +00:00
ekaterina.itsenko
650c59819e [pycharm] PY-38294 Scientific view(task): "View as array" functionality for tensors
GitOrigin-RevId: 2320c5904609b2357dd860786ac7b89b96b3878c
2024-04-24 11:57:26 +00:00
Andrey Lisin
7efde8b4be Fix Python 2.7 test environment creation task definition
GitOrigin-RevId: 36ce80c7d63e22777f905c02cd6bae5297f447d4
2024-04-24 11:25:51 +00:00
Mikhail Golubev
fcf665e761 PY-64304 EA-247016 Report illegal usages of "await" expressions even if there is no operand
In other words, in a statement like "await = 42" there are now both a warning about
the missing operand and a warning that an await expression cannot be used as
an assignment target. This behavior is consistent with other expressions where
additional parsing errors are not special-cased.

GitOrigin-RevId: 37a68eacc7ec042435c185f9ddd8bc2eea42b40f
2024-04-24 09:03:57 +00:00
Mikhail Golubev
b9d7fee816 PY-64304 EA-247016 Don't report illegal "await" expressions used as assignment targets during parsing
Instead, parse them as usual and later report in the dedicated AssignTargetAnnotator
and TypeAnnotationTargetAnnotator. This way, a PsiError element appearing in the PSI
tree of a type declaration statement doesn't cause PyAstTypeDeclarationStatement.getTarget
nullability contract violation.

GitOrigin-RevId: a3e90088cfac7938c398d4d293a72dbd127a2cd0
2024-04-24 09:03:53 +00:00
Andrey Vokin
06cf1ece7c PY-71860: make "AI Assistant" toolwindow available when promote aciton invoked
GitOrigin-RevId: 3ed03db935991f8007b83965a9ea82a2677ef897
2024-04-23 20:25:43 +00:00
Andrey Lisin
0f6a0f2964 PY-72148 Fix string representation in debugger variable view
GitOrigin-RevId: 61b98f4a25fee1738ca0950a8f93af55ac44ff3b
2024-04-23 18:47:03 +00:00
Mikhail Golubev
5f6848fccb PY-65966 Disable partial tensorflow stubs in Typeshed with a registry flag
Otherwise, incomplete stubs break our custom logic for resolving tensorflow
modules re-exported from its _api.v2 subpackage, such as tensorflow.audio,
tensorflow.image, tensorflow.random, etc.

We did the same for Numpy stubs in the past, enabling them back once they
became mature enough.

GitOrigin-RevId: b1e46067406a592761f56b7d296a287e5282b079
2024-04-23 11:03:04 +00:00
Dmitry Batrak
881b370b95 RDCT-1092 Hotkeys are displayed incorrectly in popups on different OS
replace SystemInfo.isMac with ClientSystemInfo.isMac() in keyboard-shortcuts-related code

GitOrigin-RevId: 640604dff8e09d1aeccd0edc156873dd63c09fea
2024-04-22 19:16:22 +00:00
Alexey Belkov
5ea9f88846 Migrate deprecated usages of com.intellij.refactoring.suggested.range
GitOrigin-RevId: 2fd44594219500e1c8a84841bcd4326ed7e54083
2024-04-22 12:48:24 +00:00
Andrey Lisin
f1fc631552 Restore Python 2.7 environment for Python debugger env tests
GitOrigin-RevId: 4a0e3d7dfcad262b92f2fcb4209b886e64dc2885
2024-04-22 12:17:01 +00:00
Yuriy Artamonov
f41a7c4dc9 [plugins] IJPL-148474 Use non-blocking read action to collect libraries in DependencyCollector
GitOrigin-RevId: c5b597fada22aa0e5fac524c57d5b6051e27804b
2024-04-19 20:19:19 +00:00
Andrey Vokin
7c54716a66 PY-71860: make possible to disable AI Completion Action promoter
GitOrigin-RevId: 8acdb5947e990e67013c3f4b4ccbdda05c2e03bb
2024-04-19 20:14:17 +00:00
Dima Golovkov
9faf2674f1 Update python icons for IntUI for python-psi-api for UX-3044
GitOrigin-RevId: 7d835ab3505807c81082b5db7ae6363f306d7b1b
2024-04-19 16:48:31 +00:00
Dima Golovkov
240bd4d7b2 Update python icons for IntUI for pythonCore for UX-3044
GitOrigin-RevId: eb66c30f8376ca9c7d80e8c4dc6a2e5439aa0588
2024-04-19 16:48:26 +00:00
Mikhail Golubev
319738dea5 PY-59791 Simplify extracting a wrapped type from sqlalchemy.orm.Mapped
Use PyTypingTypeProvider.getAnnotationValue for that, similarly to already
re-used in other places PyTypingTypeProvider.getReturnTypeAnnotation.

Also, I've better separated handling of attributes explicitly annotated with Mapped
and just initialized with a mapped_column call. It will help to remove special
casing for Mapped once generic descriptors are fully supported in type inference
(PY-26184).

GitOrigin-RevId: eaeb66abd26b851507970b112360631704b41db3
2024-04-18 22:59:27 +00:00
Andrey Vokin
1cc5303a3a PY-71860: AI Actions promotion
GitOrigin-RevId: 52648b965e5663a8420cf63bfa30f12de24a8b10
2024-04-18 22:30:53 +00:00
Andrey Vokin
4b947848b9 PY-71860: add AI Completion Promotion to PyCharm Community dev build
GitOrigin-RevId: 52407e14cf42d5a071e7fc086e2cef0d3a3a9020
2024-04-18 22:30:48 +00:00
Andrey Vokin
6fd89125f9 PY-71860: add AI Completion Promotion to Settings of PyCharm Community
GitOrigin-RevId: e4741fd50d0e24308a9566a07c135dd1feadfbf1
2024-04-18 22:30:37 +00:00
Andrey Vokin
702406397d PY-71860: add AI Completion Promotion to Settings of PyCharm Community
GitOrigin-RevId: dd46a2b57873b0043dfa935ab085d6de326bc01c
2024-04-18 22:30:32 +00:00
Andrey Vokin
d012a532c4 PY-71860: AI Completion Promotion should open "Install AI Assistant" toolwindow
GitOrigin-RevId: e55264d1ed982e94a3594cb7833e87e2e8927152
2024-04-18 22:30:27 +00:00
Andrey Vokin
63f63bb9ba PY-71860: make promotion action presentation customizable
GitOrigin-RevId: 2bd48a5bafc00377555d9711f253d7a844586757
2024-04-18 22:30:22 +00:00
Petr
e01b0b6beb PY-40480 Completion for argument passed to parameter hinted as Literal
GitOrigin-RevId: 462b03dc35eef70bc873b568cae239d40f1d4974
2024-04-18 20:55:14 +00:00
Mikhail Pyltsin
2152c276dc [python] Pattern variable can be used mass cleanup
GitOrigin-RevId: 04229dfd0912fbc846d4b1d5e3726ef6c9c005c6
2024-04-18 14:03:55 +00:00
Piotr Tomiak
3a14f22bc7 WEB-64707 Flaky test com.intellij.tests.BootstrapTests: org.angular2.codeInsight.Angular2HighlightingTest.testTrUnderTemplate
GitOrigin-RevId: a46fed4f6d7e64a89e44cca76bd09c6c117b0abe
2024-04-17 16:21:14 +00:00
Mikhail Golubev
ec49cd6c0c PY-29489 Rename and simplify PyTargetExpressionImpl.getTargetTypeFromTupleAssignment
GitOrigin-RevId: 7913cfdc8a4b9664b56b71ecbfde12c49d701e72
2024-04-17 11:41:27 +00:00
Mikhail Golubev
5bf2f99b65 PY-29489 Support unpacking non-generic iterable types, e.g. str or range
Use getIterationType for that, already implemented for inferring types
of for loop targets.

GitOrigin-RevId: daac45b4118629676eb37897cd08d5f8e193bf76
2024-04-17 11:41:23 +00:00
Mikhail Golubev
b70b23ca27 PY-29489 Support unpacking to targets in square brackets
GitOrigin-RevId: 470b0bd74bf3dc2ed5c8b6902df264624b50628d
2024-04-17 11:41:20 +00:00
Mikhail Golubev
8c0b817248 PY-29489 Infer types for generic iterable unpacking in assignments
GitOrigin-RevId: ac4454eae1eba2ec4c3eb71377253b1f97685561
2024-04-17 11:41:16 +00:00
Tagir Valeev
696dfffffc [java-refactoring] IDEA-92605 Detect conflicts for rename local variable
GitOrigin-RevId: 75ad577ef79dac053c689d9eb6d20dec3af222c7
2024-04-17 09:32:44 +00:00
Ilya.Kazakevich
022a8b0885 PY-71792: WSL broken in Python plugin for Idea.
With a new workspace model, forced by the platform, old SDK paths are now saved in `//wsl` instead of ``\\wsl`` formats.
`CUSTOM_PYTHON_SDK_HOME_PATH_PATTERN` failed to recognize them.

Check is also added to `getVersionString` not to pollute logs with things like "Can't run `//wsl$/usr/bin..`".

GitOrigin-RevId: d9a5c4cb8972eee841219b52bf596468e52e770a
2024-04-16 23:20:17 +00:00