Commit Graph

258 Commits

Author SHA1 Message Date
Dmitry Trofimov
f0399e1662 Decouple Python intentions
GitOrigin-RevId: e87aa7f8fde189ff2a48793879e27617ff6297e7
2020-05-01 18:44:38 +00:00
Peter Gromov
93611b8f20 don't create python soft file references when searching for Java methods
GitOrigin-RevId: 25c35182c9af038fe2e00ef606163080b3db74d2
2020-05-01 09:40:21 +00:00
Peter Gromov
53158fdcc0 don't create Python doc string references when searching for Java methods
GitOrigin-RevId: 26b36ed7904fb00e110ec876b69c28e3985f6405
2020-05-01 09:40:21 +00:00
Semyon Proshev
25925a4107 Move from deprecated method usage
GitOrigin-RevId: 65e2eebbb315de1bd35db432105ac9bf8c406971
2020-04-29 22:14:33 +00:00
Semyon Proshev
d8b73c02fb Unify logic of calculating language level for a file
1. Forced language level via test only method
2. Specified language level via separate method for programmatically created file
3. Pre-calculated language level for the containing directory
4. Language level of the file sdk
5. Maximum language level among project modules

GitOrigin-RevId: b6a2b382807c4170020fd6ad045ddbd7523add64
2020-04-29 22:04:28 +00:00
Semyon Proshev
b512c54fad No need to provide a language level to directory
Since project directory will be covered by getImmediateValue(Module).
Directory under other root will be covered by UpdateRootTask.

GitOrigin-RevId: 948ac06da4c3356ea3c9e3102bbac150bc81ea9c
2020-04-29 22:04:28 +00:00
Semyon Proshev
a31df00106 Final move of file-level language level processing to PythonLanguageLevelPusher
GitOrigin-RevId: 286eded864247414e9babf109a8a61f7dfb75662
2020-04-29 22:04:28 +00:00
Semyon Proshev
e0a2c6bed7 Move file-level language level processing to PythonLanguageLevelPusher
GitOrigin-RevId: f3be772f643c75652ea3557ef34ec62518a558d2
2020-04-29 22:04:28 +00:00
Semyon Proshev
44ebee4295 Move project-level language level processing to PythonLanguageLevelPusher
GitOrigin-RevId: 8e9a03c6ebe4ff6edec7a1cbd73821fba666d1d0
2020-04-29 22:04:28 +00:00
Semyon Proshev
b9a7df929c Make PythonLanguageLevelPusher saving string into user data holders (PY-41923)
GitOrigin-RevId: 53b43afda6758e21f7022ee2b2326db547628c31
2020-04-29 22:04:28 +00:00
Mikhail Golubev
eb9f018d8f PY-41923 Make Pythonid.magicLiteral dynamic by using CachedValuesManager instead of PsiCacheKey
Since PsiCacheKey-referenced values are not automatically cleared on a plugin
unloading.

GitOrigin-RevId: c0a0bba20ac58643e8cae12021f5cd962130ef4b
2020-04-29 22:04:28 +00:00
Semyon Proshev
c6b8e86dc7 Remove NonExtendable annotation from final classes
GitOrigin-RevId: 65e05f2b569a5106dd3354bac9a314dcb706451d
2020-04-29 22:04:28 +00:00
Mikhail Golubev
94c01f239f PY-41923 Mark EPs for custom target expression and class stubs as dynamic
Also, mark them as @ApiStatus.Internal instead of @Deprecated. These EP however
won't be safe to use as soon as we decide, e.g. to extract Django support into
a standalone plugin, because unloading it won't trigger rebuilding of indexes
in the current implementation leaving unused custom data in them.

GitOrigin-RevId: 3dbe4bee616c500409a088b825e3252615167069
2020-04-29 22:04:28 +00:00
Mikhail Golubev
41f7540037 PY-41923 Mark Pythonid.importCandidateProvider as dynamic
GitOrigin-RevId: 1d0dc50cafc724811bfbd336c1ecd2d62d430695
2020-04-29 22:04:28 +00:00
Mikhail Golubev
bb0c52a8c8 PY-41923 Don't cache extensions of Pythonid.knownDecoratorProvider
GitOrigin-RevId: 91999f358b91e38d4014c8261a9ad7f247638c88
2020-04-29 22:04:28 +00:00
Semyon Proshev
e219ead527 Make several EP dynamic (PY-41923)
PyBreakpointHandlerFactory, PyConsoleOptionsProvider, PyPregeneratedSkeletonsProvider, PyClassMembersProvider, PyCanonicalPathProvider and PythonVisitorFilter

GitOrigin-RevId: d5b55eae82a2b1334ecbdcadc2bfe7c3a2f29512
2020-04-29 22:04:28 +00:00
Semyon Proshev
68b5d36ff3 Make several EP dynamic (PY-41923)
PythonRemoteInterpreterManager, Pep8ProblemSuppressor, PySdkComparator, PyReferenceCustomTargetChecker and PyDataclassParametersProvider

GitOrigin-RevId: 13acf82111e175f2095b6abc4b8838ba47a0fe16
2020-04-29 22:04:28 +00:00
Mikhail Golubev
a41d39cd3b PY-41923 Get rid of overriding bridge services in python-core-common.xml
by moving the registration of stub implementations for code-insight bridge services
from PythonPsiImpl.xml down to PythonAnalysisToolPlugin.xml where they are actually
used. All the other products using PythonPsiImpl.xml seem to include it via
python-core-common.xml, so each of them will safely get the real *ServiceImpl
implementation of the corresponding bridge.

GitOrigin-RevId: 2cf83ab8ff99efcc9ed432634e4f2d614a18cc8b
2020-04-29 22:04:28 +00:00
Semyon Proshev
e0ecc967ce Add a cache to PythonDialectsTokenSetProvider (PY-41923)
GitOrigin-RevId: 0bc6ab1cbffc795afc371046e4b322d83865348c
2020-04-29 22:04:28 +00:00
Semyon Proshev
4ee0890a8a Make PythonDialectsTokenSetProvider a service (PY-41923)
No caching at the moment.

GitOrigin-RevId: 830494e178f8177073134b3fb674e332ce2e18b6
2020-04-29 22:04:28 +00:00
Mikhail Golubev
5602ec0b70 PY-30282 Return the placeholder docstring rendering result right away in tests
PythonDocumentationProvider#generateDoc is invoked without a non-blocking read
action there and, thus, doesn't have a corresponding progress indicator resulting
in NPE before we get to Application#isUnitTestMode check.

GitOrigin-RevId: 97bc60401b448b3f8f27efff00f81ea0476706cb
2020-04-29 11:14:01 +00:00
Mikhail Golubev
cc311ec931 PY-30282 EA-209938 Don't render Python docstrings in external process under read action
The helper script for rendering it is now launched synchronously in a pooled
thread while the origin thread holding the read-write lock is constantly
checking whether it was cancelled by incoming write action. If it was, it
terminates preliminary and later rescheduled again thanks to the capabilities
of NonBlockingReadAction. The pooled thread meanwhile will keep running waiting
for the output of the script (up to 5 seconds timeout). Normally it shouldn't
happen, though, and at least Quick Documentation no longer affects the editor
responsiveness. It's a workaround for the current platform API limitation
that queries ordinary documentation providers under read action with no way to
opt out.

GitOrigin-RevId: f74e67d67381326ce7685ff5fa31d42bffacb8be
2020-04-29 07:15:24 +00:00
Semyon Proshev
8033b2cb2f Put metaclass.__call__ after constructors to make navigation opening class instead of metaclass (PY-17877, PY-41380)
GitOrigin-RevId: 3c46d5ec6b1ab2af2983fa68878446c9a6d46ffa
2020-04-28 22:03:32 +00:00
Semyon Proshev
46aaf3e7d9 Append metaclass.__call__ to constructors, do not replace them (PY-17877, PY-41380)
GitOrigin-RevId: 58a2e10b45ee0ca1ad3f67ef28d74c2477361c96
2020-04-28 21:08:25 +00:00
Semyon Proshev
40c9d375e5 Don't consider metaclass.__call__(cls, *args, **kwargs) as a possible constructor (PY-17877, PY-41380)
GitOrigin-RevId: de83bde719d08de70dcff7f3ad7dfa722a66af72
2020-04-28 21:08:25 +00:00
Dmitry.Krasilschikov
0cb2e0b83c more @NlsContext APIs annotations
GitOrigin-RevId: 02449936ce47b493963a7a1af1c6eb5b11386d66
2020-04-28 19:16:33 +00:00
Ilya.Kazakevich
18c1e98d54 Logging deprecated method usage
GitOrigin-RevId: f477b9aa83e5337399a5b798a21cd0d5c1490d7c
2020-04-26 22:37:36 +00:00
Eugene Petrenko
5933433cd5 FilePropertyPusher - cleanup FilePropertyPusher#initExtra method API (remove MessageBus parameter)
we do not have any usages of the method with messageBus parameter, added new method without it and delegated to the previous one for backward compatibility

GitOrigin-RevId: 2bf2eb051adc81ad386c1f06288b5fd889d16514
2020-04-24 12:36:53 +00:00
Semyon Proshev
ea6c0181df Completion for string passed as an argument to a parameter type hinted as str or PathLike (PY-33254, PY-12339, PY-40834)
GitOrigin-RevId: 87e0aef80a2b458b888c4e8ad072efd94f8bafc6
2020-04-23 22:26:52 +00:00
Semyon Proshev
36a6a3ab65 Move the check that actual type is definition if type var is definition to the top of the corresponding method.
GitOrigin-RevId: e2cfe01d00159b76bc3257df771b76bc2bec89fb
2020-04-17 21:12:01 +00:00
Lada Gagina
61ad4c3109 IDEA-CR-61508: PY-39703 Add TypedDict keys completion
GitOrigin-RevId: b4e71d5edff69b23e1f1eb68ffe77f994a6a0293
2020-04-16 20:10:49 +00:00
Semyon Proshev
04a502ed31 Simplified matching instances and definitions (PY-38786)
The problem was that every definition matches `TypeVar(..., bound=type)` since it's metaclass is `type`.
The metaclass successfully matches expected class but no substitution is created.

Tests were updated since now `A` matches `_C = TypeVar("_C", bound=type)` in attrs stubs and `A` is inferred.
In any case `attrs` support is tested in other tests, these tests are about unknown (for us) decorators.

GitOrigin-RevId: ced931bd2ff732a8f7a95726d3f2837417d2d6c2
2020-04-16 17:05:07 +00:00
Semyon Proshev
17d5a4bbce Restrict matching against callables (PY-29993, PY-28364)
Expected class-like types are not considered as callables (exclusion: bare typing.Callable).
Fix matching definition against metaclass.

GitOrigin-RevId: a2fe59c3bc7f56ef08dfb960a9ed841a86a65815
2020-04-16 17:05:07 +00:00
Vladimir Krivosheev
deefb65593 deprecate newConcurrentMap
GitOrigin-RevId: 21130180446c9bb940046c3d4301c99d35408b3f
2020-04-16 11:48:07 +00:00
Vladimir Krivosheev
444b7d3d40 get rid of Lists.newArrayList
GitOrigin-RevId: d785fe6fab133812585561c391d7d3556d5792f7
2020-04-16 08:29:17 +00:00
Semyon Proshev
03ee050114 Don't resolve underscore-prefixed names in pyi files since they are private (PY-40233)
Known exclusion is _PathLike from builtins.

GitOrigin-RevId: eb733982acf0992fbae822d0feb582fb07ad010f
2020-04-15 21:03:02 +00:00
Adam Hood
e25f6e273f LAB-31: remove unused parameter in ImportChooser
GitOrigin-RevId: f45473ad54e007aef3d6d1cb7b479dd3830b68e6
2020-04-14 14:01:52 +00:00
Alexander Koshevoy
743ce8c3a2 Move Cython parser's messages from PythonProBundle.properties to PyPsiBundle.properties
GitOrigin-RevId: fdeb63629b40d0505863ce7c8df79cefc3841ab3
2020-04-10 16:06:12 +00:00
Alexander Koshevoy
f9e153addd Move the message from CythonFunctionParsing to PyPsiBundle.properties
GitOrigin-RevId: 4e3013d8b12786df7617399ad46765b0203579c1
2020-04-10 16:06:12 +00:00
Alexander Koshevoy
6a7da3f143 Move missed messages in PyPackageRequirementsInspection from PyBundle.properties to PyPsiBundle.properties
Fix up for the changes 71e300329addb702f3f603f58174f3f16e688ad6.

GitOrigin-RevId: 2056e93f3fbfb92e9b471470f6c153a567ee9e9d
2020-04-10 16:06:12 +00:00
Semyon Proshev
55499dd783 Attempt to reduce idempotence checker failures by reducing number of thread locals and updating recursion keys.
GitOrigin-RevId: d6a50f0ac753d8b0add67baa61ac97209dcbbaff
2020-04-09 14:09:04 +00:00
Lada Gagina
13da1f833e IDEA-CR-61203: PY-40906 Fix PyTypedDictInspection so Literal can pass as TypedDict key
GitOrigin-RevId: 0985470f5936ad09179867d01ee129514a5ee10c
2020-04-07 21:02:45 +00:00
Ilya.Kazakevich
8200dc1f33 PY-40431: i18n
GitOrigin-RevId: ac9e98b134b6882e2d1e3b8ccc9e44a711414616
2020-04-01 23:03:36 +00:00
Dmitry Trofimov
5e1b23d3e3 Fix NPE
GitOrigin-RevId: 8c60b233f7ae8d4e625441af1b5e582c55fba4df
2020-04-01 15:32:04 +00:00
Dmitry Trofimov
58852d7e94 Fix exception
GitOrigin-RevId: f8f963bb5e179d3bbacfe62b76e3a59cdeb97c98
2020-04-01 15:32:04 +00:00
Dmitry Trofimov
a62670a4f0 Fix NPE
GitOrigin-RevId: e4993ed28c3a9932c7b976d56fb56975b5a692be
2020-04-01 15:32:04 +00:00
Andrey Vlasovskikh
641b54e254 Moved a message that was left in the old bundle leading to exceptions
GitOrigin-RevId: 47a7fee9bda868e9c0bdedbbc47625478cc7f321
2020-04-01 12:31:42 +00:00
Dmitry Trofimov
3e9f6983a8 Merge decoupled inspections
GitOrigin-RevId: bdd58f7021b0d946ccc1a0b801050eca3856b397
2020-03-31 18:46:10 +00:00
nik
fc7b7c2676 [python] don't process dependencies of modules when visiting roots of all modules in project
Otherwise modules from dependencies will be processed many times, in the worst case this will take quadratic time by number of modules and may lead to UI freezes if there are many modules in the project (PY-41402).

GitOrigin-RevId: b05df2eea95aeac1b6bfcabe0970b720c775a29b
2020-03-31 14:31:51 +00:00
Vladimir Krivosheev
d669742145 cleanup - use Objects.equals instead of Comparing.equal
GitOrigin-RevId: 37d620c12497b0add4fb7bbd9119d2b5ba79a457
2020-03-31 14:31:51 +00:00