Commit Graph

3972 Commits

Author SHA1 Message Date
Semyon Proshev
26ecc11963 Revert fec8e404 and 6a55c56f in order to fix building dmg
GitOrigin-RevId: 02f6104ca8bbd91cbac617af07161f46cc68159e
2019-09-30 16:34:17 +00:00
Semyon Proshev
7d84c77325 Make a switch to original element when pyi-one has been found in order to determine if its deprecated or not (PY-38101)
GitOrigin-RevId: baf95e1db4db898d1e18051972f69799c95fa3b0
2019-09-30 12:05:27 +00:00
andrey.matveev
e62d70bc56 Fix PY-7018
GitOrigin-RevId: 56344326c46ce29b03fd3733cff0c989b357e594
2019-09-30 10:32:59 +00:00
andrey.matveev
febdc1ae36 Fix PY-13111
GitOrigin-RevId: 3b4c03eabb6b4ae26343afc58d598a379e9a80bf
2019-09-30 05:31:39 +00:00
Aleksei Kniazev
aaaf2828d9 regression with moving future import to the top, test for extended completion (PY-23475)
GitOrigin-RevId: 218984c89d2229b6a32947650f46df4f1c3aecef
2019-09-27 16:33:17 +00:00
Aleksei Kniazev
0d5f27c47d imports are inserted after module-level dunder names to comply with PEP-8 (PY-23475)
GitOrigin-RevId: 9cad837e708f3c9e52abea59d9e239371cb515bc
2019-09-27 16:33:17 +00:00
Andrey Lisin
4e5852d366 IDEA-CR-52512: PY-26541 Fix formatting in data view panel
GitOrigin-RevId: ddcb33ebe7ad16c46def53c0cfd40e3bbcd27c77
2019-09-27 09:32:40 +00:00
Semyon Proshev
5ce281fc20 Reduce using mock sdks, attach necessary files manually instead.
GitOrigin-RevId: fec8e4042fb2aff59741e9e82c857d307169ae16
2019-09-26 13:06:20 +00:00
Aleksei Kniazev
2c8ff937db IDEA-CR-51700: go to definition/implementation on file should lead to py files instead of pyi (PY-35129, PY-32345)
GitOrigin-RevId: 0390bc3103ff22903e96d1a669cd4a6aca0980e9
2019-09-24 10:02:18 +00:00
Semyon Proshev
aebe0cf30e Type inference for variables explicitly type hinted as Literals (PEP 586) (PY-35235)
GitOrigin-RevId: c9ff4b5904021dca6b7c4c7a81d5e24692654299
2019-09-23 17:32:37 +00:00
Semyon Proshev
848405926a Support specifying namedtuple name and fields through keyword arguments in any order (PY-29983, PY-34134)
GitOrigin-RevId: 8489e8af74b80dd3fd700a2039d97d2de985ce3b
2019-09-18 15:22:30 +00:00
Semyon Proshev
bba4c58b25 Sync with typeshed @ 2b97bb904af4d7120243beb6ebf5ce0e4bc85041 (PY-34867, PY-37171)
Enable support for typing.OrderedDict.

GitOrigin-RevId: e5235d0377cec4c6dcdcf4d67ffd14737ef1b47c
2019-09-17 19:01:39 +00:00
Semyon Proshev
ebeaf3cb98 Support specifying namedtuple fields through keyword argument (PY-29983, PY-34134)
GitOrigin-RevId: bd3482d76bab385247df02230403ef5f721fa2db
2019-09-16 17:03:01 +00:00
Andrey Lisin
2d8453d970 PY-37645 Add Python debugger fallback exception hook
GitOrigin-RevId: e5f9bbd865e25eeae19842b983ba6855dfeba250
2019-09-16 16:33:16 +00:00
Semyon Proshev
88f1c2d6d1 Made tensorflow resolve more complex as its internal paths had been changed in 1.15.0rc0 and 2.0.0rc0 (PY-37589)
GitOrigin-RevId: 39e18cf4ca56eb2379d2664e5ad07647985943cb
2019-09-16 16:01:43 +00:00
Semyon Proshev
a799c255fe Fix introducing variable for argument passed to unnamed parameter (PY-37555)
GitOrigin-RevId: 6a595635c62bac01e6bdb6cbbd284eb52a64f16f
2019-09-16 16:01:43 +00:00
Dmitry Trofimov
a0bc048dcc python-psi-impl extracted
GitOrigin-RevId: e3d808c147ac793701c7b628dbf825a99bb71f2a
2019-09-11 19:15:01 +00:00
Aleksei Kniazev
fbfef48442 support namespace packages defined via pkg_resources and pkg_util (PY-16688, PY-23087)
GitOrigin-RevId: fc979a18d3c8bf310f6ae4381ac7f365e8b6c180
2019-09-09 10:02:33 +00:00
Aleksei Kniazev
3c203f5382 IDEA-CR-51590: added self parameter for methods on smart enter (PY-35163)
self is inserted for methods that are not class-/staticmethod
cls is inserted for classmethod
empty parameter list for staticmethod

GitOrigin-RevId: 9743ae50c89c069b8123b8b6eb26fb841dd1f5b2
2019-09-04 15:08:25 +00:00
Andrey Lisin
abd6ecef4d PY-37580 Add unit test for stepping into in new thread
GitOrigin-RevId: 4e27a685170fe20201e1aeb579747f4f23d03628
2019-09-03 15:34:42 +00:00
Aleksei Kniazev
87224ec7bd IDEA-CR-51115: 'inline this invocation only' option should not be available when calling inline on function declaration (PY-37335)
GitOrigin-RevId: 42021bca7333b16a38fc8eb0a6fae0ca56640f54
2019-08-29 14:09:57 +00:00
Ilya.Kazakevich
95808b76f5 PY-15021: Don't create Unittest-based classes for pytest (after IDEA-CR-51246)
GitOrigin-RevId: bdc36c6c7b43dabdfb4e7620462f0a2610087890
2019-08-29 13:44:54 +00:00
Ilya.Kazakevich
d416323604 PY-15021: Support pytest test creation
For UnitTest you need to create class. However, pytest accepts plain function tests ("test_..").
We should not force user to use classes.

Also, many small improvement added:
* detect test folder
* create tests for everything in class
* do not create tests for tests

GitOrigin-RevId: 85dbe09e4fea47a116aaac9c00cec884f46bae9e
2019-08-29 13:44:54 +00:00
Aleksei Kniazev
aaf91c7e4b IDEA-CR-51205: undefined global inspection now works for all mentions of global var in the file (PY-37623)
GitOrigin-RevId: 5be5b5da4663555f24f9dfb88dde9c9ef68808db
2019-08-29 13:27:53 +00:00
Aleksei Kniazev
61f435f185 IDEA-CR-51205: undefined global inspection should compare scopes of resolved targets (PY-37415)
I reverted changes in 235f566771e9bd83c5b04e47c170501830b5c66a and modified PyUndefinedGlobalInspection instead, to restore global variable discovery in Scope methods

GitOrigin-RevId: 6b432b2c2364cd94dc8463ea773a02350d9e915f
2019-08-29 13:27:53 +00:00
Andrey Vlasovskikh
e6b823602e PY-20174 Don't take into account __all__ inside classes or functions
We used to use __all__ even if it was defined on the class level, even though you can only influence the names
exported by a module via a file-level __all__.

This fix requires re-calculating __all__ in PSI stubs, that's why we've incremented the stub version.

GitOrigin-RevId: bfc87d0bff7eb94c446ac453872d742081689729
2019-08-29 13:27:53 +00:00
Ilya.Kazakevich
ffadfee6cb IDEA-CR-51828: PY-23394, PY-18501, PY-37571: Use new test runners when running tox
When we see test runner in "commands" section of tox, we substitute it with our test runners so user may benefit from test trees.

We also pass "offset" because test runners must use it as "parent node".

Set "_jb_do_not_patch_test_runners" to disable this substitution

(cherry picked from commit c7d469e1fed52f2d7fe3aec6d96b665c4aa80a4e)

GitOrigin-RevId: b9eec43a6d26fecb72270b733266ef31989fec2c
2019-08-28 13:07:04 +00:00
Ilya.Kazakevich
a08e201eb7 PY-18501: test for latest pytest+tox
GitOrigin-RevId: 3dee65df902bfc99cd670b2e88fb38b1e065a6b4
2019-08-28 12:42:07 +00:00
Andrey Lisin
13703f2d53 PY-35999 Ignore exceptions in library files when debugging
GitOrigin-RevId: aea3f28d3941c9add7ee0620d382371d9246f1a6
2019-08-27 15:43:02 +00:00
Andrey Lisin
e97594f3ec PY-36512 Fix code evaluation in Python debugger console
GitOrigin-RevId: 957840f627471337a6174b356420a39eb87bc71b
2019-08-27 15:43:02 +00:00
Tagir Valeev
0d75036403 JoinLines: better comments processing
1. Improve the support of other languages in CommentJoinLinesHandler
2. Respect right margin in CommentJoinLinesHandler
3. JoinLineProcessor#convertEndComments: do not convert if only whitespaces are going to be added
4. JoinLineProcessor#adjustWhiteSpace: do not add white-spaces before line-break
Also fixes IDEA-125325 Join lines in custom file type should handle end-of-line comments

GitOrigin-RevId: 392fe2455dcf19d21303a0b42ee85db7f824fa85
2019-08-27 11:01:35 +03:00
Semyon Proshev
57216e2429 Extract some tests to separate test cases because they need Python 3 typeshed roots (PY-33830)
Remove `abc.py` used in tests and mock sdks

GitOrigin-RevId: 8f27bb056ccfbcd7961c48298b0076bed4cd0389
2019-08-19 19:59:56 +03:00
Semyon Proshev
34ae8b9265 Move highlighting continue under finally to compatibility inspection (PY-36003)
GitOrigin-RevId: d644848d69b91c4ee05f1342f804e58ea137aac2
2019-08-15 22:02:02 +03:00
Semyon Proshev
d50b3ad7ea Don't mark continue in finally block as an error in Python 3.8+ (PY-36003)
Enable a test that no one is care of.

GitOrigin-RevId: ccc520d6ab6d40117b5ff69ffe908ef135c6a08b
2019-08-15 22:02:02 +03:00
Semyon Proshev
121f06d991 Avoid parsing RHS of assignment expression as target (PY-33886, PY-36479)
GitOrigin-RevId: 127743a6386b8155ba131fa7f249c761598880e1
2019-08-13 17:04:49 +03:00
Semyon Proshev
ba8411f567 Better handling of incomplete assignment expressions (PY-36479)
Create assignment expression even if its LHS or RHS is invalid.

GitOrigin-RevId: 6905a3b255f0c1fad576049265e39c0434f2d8e3
2019-08-13 17:04:49 +03:00
Aleksei Kniazev
23580c16ee IDEA-CR-51114: multiresolve import references instead of single resolve (PY-32268)
There can be several resolve results for import reference. One of the examples is namespace package, when we have to consider elements from several locations for completion.

GitOrigin-RevId: 4ac824ca1f7031b2adda119684d837c6d21b3212
2019-08-07 12:04:38 +03:00
Andrey Lisin
ce63f394dd PY-36726 Fix debugging for some old Python versions
GitOrigin-RevId: 61fe96ab129b7eddb8394faa67e8557480bc2982
2019-08-06 18:06:34 +03:00
Andrey Lisin
6c8c1beb19 PY-37120 Python debugger - properly stop on syntax errors
GitOrigin-RevId: e6280732fc658ed22741ac3cc5ba2535b4979e05
2019-08-05 22:03:31 +03:00
Semyon Proshev
db775d0e0f Remove modules that are imported as members (PY-33034)
It means that you're not able to write `import tensorflow.<name>` with them.

Remove `tools` from tensorflow >= 2 modules as it is not completed in test but completed in IDE. Should be investigated later.

GitOrigin-RevId: 7dfc22494e701048f99bb0d3a732a0cdc8b7c23e
2019-08-02 15:03:24 +03:00
Semyon Proshev
c1caf42b31 Env tests for tensorflow submodules and subpackages (PY-33034)
GitOrigin-RevId: a98ff02950327a6fa7dc19ec5f88205915281451
2019-08-02 15:03:24 +03:00
Semyon Proshev
2a559ec31a Don't mark named unicode character as an error in Python 3.8+ (PY-36004)
GitOrigin-RevId: 59b52a42e5c820a6603e6734e768f035c5c593e5
2019-08-01 16:03:35 +03:00
aleksei.kniazev
a4c6f8d8bd IDEA-CR-45845: new ordering rules for completion and autoimport quickfix (PY-20976)
items defined in the project > items from the standard library > items from other libraries
doesn't start or end with _ > starts with _ > starts with _ > starts and ends with __
items with no leading _ in import path > with leading _ in import path
function/variable/class > module/directory
less items in the import path > more items in the import path

GitOrigin-RevId: 7fba600668d7f7eab4dbd5d3891811cfe2501b89
2019-08-01 12:04:14 +03:00
AMalykh
fefba3ab2b PY-32269: Fixed bug with completion of parameters before = sign.
GitOrigin-RevId: bb619c210c66a595ff015494b4b553a15cf24c1e
2019-07-26 17:05:06 +03:00
Aleksei Kniazev
33632c12c2 IDEA-CR-49790: function inline: already imported names should not be reimported (PY-36803)
GitOrigin-RevId: b2bd04bcfc09898db6accd94210fb8c2097e7c92
2019-07-09 13:03:53 +03:00
Mikhail Golubev
b7135bae76 PY-15603 Remove special processing for class member, rely on getQualifiedName()
Since we use "." as a separator there now and getQualifiedName() for classes
and functions already properly handles nested classes and methods, there is
no need to duplicate this logic in PyQualifiedNameProvider.

GitOrigin-RevId: e5101764b84061e3690fc09b399b85a133ae9223
2019-07-08 21:02:18 +03:00
Mikhail Golubev
422c6aa643 PY-15603 Clean up in PyQualifiedNameProvider, add tests on class members
GitOrigin-RevId: 8082da991199b19830ff565065ef4d2d9124b37d
2019-07-08 21:02:18 +03:00
Aleksei Kniazev
2d720aea16 IDEA-CR-49176: fixes after review of function inline for python
- codestyle improvements
- reuse TypeEvalContext and PyResolveContext
- check PyDunderAllReference specifically to avoid unwanted side effects
- skip resolving PyTargetExpression
- replace references with import alias in the refactoring, instead of the utility method
- added single reference search for PyStringLiteralExpressionImpl
- cleanup obsolete tests

GitOrigin-RevId: 3e33c880a8fe116a5b98583059c83b7dd67e34a2
2019-07-08 18:05:36 +03:00
Aleksei Kniazev
e867306f59 IDEA-CR-49176: inline function: optimize imports at declaration site after removing function definition (PY-36721)
GitOrigin-RevId: 2bf0ffdeff5a2b5cd084b53b5e1ed76d547d07f2
2019-07-08 18:05:36 +03:00
Aleksei Kniazev
d672b03510 IDEA-CR-49176: improved check for self usage when inlining a function (PY-36471)
GitOrigin-RevId: 3e99835432e2b5382c257bbe4375aacb94da16bc
2019-07-08 18:05:36 +03:00