Commit Graph
3279 Commits
Author SHA1 Message Date
Semyon Proshev 9941c8e40a Improve PyKnownDecoratorUtil to support more decorator side-effects (PY-26023) 2017-11-20 17:26:46 +03:00
Semyon Proshev 44a9986bdb Mark duplicated *args and **kwargs as not allowed (PY-26491) 2017-11-20 17:11:05 +03:00
Semyon Proshev 1dfa08e124 Collect metaclass members while calculating class member names (PY-21408) 2017-11-16 14:37:55 +03:00
Semyon Proshev d270f9f48d Match most types with structural one by resolving its members (PY-21408) 2017-11-16 14:33:30 +03:00
Semyon Proshev 80b3375629 Handle namedtuples unpacking (PY-4351) 2017-11-15 18:21:57 +03:00
Semyon Proshev eb5094feda Fix call type for open functions (PY-16893, PY-16894, PY-26313) 2017-11-14 14:32:54 +03:00
Semyon Proshev 313daaaba9 Fix inferring type for await on imported coroutines (PY-26847) 2017-11-11 00:00:32 +03:00
Semyon Proshev de1dca36da Match every type against unresolved receiver generic (PY-25994) 2017-11-08 18:09:11 +03:00
Semyon Proshev 3512c70dc3 Ignore format args reassignment in cycles (PY-26028) 2017-11-08 18:07:45 +03:00
Semyon Proshev 45beb4e273 If smth is listed in __all__ but not found, add module to results. (PY-26243, PY-25751) 2017-11-02 14:24:26 +03:00
Semyon Proshev ee509d0158 Always resolve references to property to getter 2017-10-31 17:34:12 +03:00
Semyon Proshev 9287028517 Prevent recursion while resolving references (PY-26006) 2017-10-31 17:33:54 +03:00
Mikhail Golubev 0e3662f1ed PY-12008 Restore alignment of the closing parenthesis after a "glued" string literal
Additionally, check that "Align collections and comprehensions when
multiline" setting doesn't affect it as it used to.
2017-10-30 14:09:46 +03:00
Mikhail Golubev fc30a55f54 PY-24160 Do not give indent to a binary expression in parentheses
Use ContinuationIndent instead of ContinuationIndentWithoutFirst
for its operands and operators instead. This way we don't over-indent
a condition in parentheses when the opening bracket is on its own line.

Also test that binary expressions in other positions are not
over-indented thanks to the use of ContinuationWithoutFirst for them.
2017-10-30 14:09:46 +03:00
Mikhail Golubev 88263da53c PY-12008 Keep existing behavior when all statement conditions are not aligned 2017-10-30 14:09:46 +03:00
Mikhail Golubev 2d6b2b2727 PY-12008 Use another type of block for binary expressions
in order to the structure of nested binary expressions during
formatting. For instance, "x and y or z" and "x or y and z" should
be formatted the same regardless of the precedence of individual
operations.
2017-10-30 14:09:46 +03:00
Mikhail Golubev b8b70bb856 PY-12008 Add a bunch of tests covering various cases of malformed if statements 2017-10-30 14:09:46 +03:00
fitermayandAndrey Vlasovskikh 851bcd66e8 PY-8933/PY-8203:Fix false positives in "Import in try block..." inspection 2017-10-26 22:55:10 +03:00
Semyon Proshev a41365069e Don't resolve forward outgoing references in class except cython and pyi (PY-26368) 2017-10-25 19:04:00 +03:00
Semyon Proshev f98eca6612 Always use path to target in AddImportHelper.addImport (PY-25484) 2017-10-23 19:48:31 +03:00
Semyon Proshev 62d2b29407 Fix calculating class ancestors in structure view (PY-19078) 2017-10-23 19:44:32 +03:00
Semyon Proshev 55949b3eb4 Fix highlighting for empty raises (PY-26510) 2017-10-23 19:42:13 +03:00
Mikhail Golubev 8769595543 PY-18216 Move and other refactorings don't run full-blown optimize imports
but rather only delete unused imports so as not to cause unwanted
changes in affected files.
2017-10-23 18:58:30 +03:00
Mikhail Golubev dcb69ad408 PY-25567 Keep parentheses around re-ordered from imports in optimize imports
It doesn't affect new imports received as a result of joining several
existing ones sharing the same source. For them user must explicitly
set preferred type of formatting in code style settings.
2017-10-23 18:58:30 +03:00
Mikhail Golubev 0d89738e05 PY-25234 Fix ordering for imports resolved into binary skeletons of stdlib
Previously, we used the priority of the binary skeletons directory
itself, thus placing them in a wrong THIRD_PARTY group.
2017-10-23 18:58:30 +03:00
Semyon Proshev dcd9826a4c Honor packages installed inside module (PY-20489) 2017-10-19 14:45:46 +03:00
Semyon Proshev 2566350b28 Don't forget to ignore union types with unknown members (PY-22312) 2017-10-19 14:37:47 +03:00
Semyon Proshev 672f71e67f Fix the order of methods passed to PyImplementMethodsQuickFix (PY-25906) 2017-10-19 14:36:24 +03:00
Semyon Proshev b0f3e6c20b Methods to implement will be printed in the same order as shown in dialog (PY-25906)
Every of them was inserted after statement list so the last method becomes the first.
The problem is fixed by reverting writing order.
2017-10-19 14:36:23 +03:00
Semyon Proshev bcafbf851a Increase priority for classes from already imported modules.
PY-3563 fixed.
2017-10-18 18:59:17 +03:00
Semyon Proshev bd137484c8 Sync testdata with f6553f228f.
PyWrapInExceptionQuickFixTest.testInFunction and testSimple fixed.
2017-10-11 19:08:15 +03:00
Ilya.Kazakevich 3a63ae3f23 PY-26432: assertEquals should not break subtests
Fixed on Leonid's site
2017-10-11 18:50:24 +03:00
Dmitry Trofimov 79ffc852b7 Move test data for unified parsing to separate folder 2017-10-09 21:23:29 +02:00
Dmitry Trofimov 210bf9b175 Unify stubs for all Python language levels (PY-26392)
The cause of the problem was the difference in parsing for different
language levels.

This commit improves error recovery and adds support for stubs for
syntax elements unavailable in older Python versions.
Cases that are covered are necessary for stubs generation
for Python 3.6 standard library. They are discovered by automatic
validation executed by stubs generator in StubsGenerator.kt.

Those are the cases that were fixed:
* A stub for single star argument in Py2 was absent
* Type annotations in Py2 were absent
* Print with end argument in Py2 broke parser
* Exec function as argument in Py2 broke parser
* Async keyword after decorator broke parser

All the cases are listed as test cases in PyUnifiedStubsTest

P.S. It is possible though that more cases will be revealed in future.
2017-10-09 21:23:29 +02:00
Elizaveta Shashkova a3dffc58ac Add ability to load variables in the Variables Pane asynchronously (PY-12987)
If in the frame there is at least one very long or slow variable, the frame's variable aren't shown. In order to avoid such situations we add an option to load variables asynchronously. At first debugger loads only names of the variables, and after that it sends additional commands and evaluates values of the variables in a separate threads.
2017-10-09 21:20:18 +03:00
Semyon Proshev 627a2ef4a8 Ignore underscores in PyAssignmentToLoopOrWithParameterInspection
PY-26137 fixed.
2017-10-09 18:43:39 +03:00
Mikhail Golubev d5fb34404e PY-20401 Use a lower highlighting level for annotations
So that other annotations, such as the one for builtin symbols, always
have priority over it, but it still was possible to, say, add
a background color or a font style for type annotations using this new
settings.
2017-10-09 14:56:50 +03:00
Mikhail Golubev 0dd7aef0c1 PY-20401 Don't highlight anything else inside highlighted annotations 2017-10-09 14:56:50 +03:00
Mikhail Golubev 47144c3dfe PY-11418 Don't highlight builtin function calls as calls additionally 2017-10-09 14:56:50 +03:00
Mikhail Golubev f6fe43223b PY-20401 Rehighlight None, True and False to keep their color inside annotations
Otherwise, they have the same color as enclosing annotation that is
different from the way we treat builtin symbols like 'str' and 'int'
there.
2017-10-09 14:56:50 +03:00
Mikhail Golubev 05b24abf3c All annotators adding syntax highlighting also include message for tests 2017-10-09 14:56:50 +03:00
Mikhail Golubev 9ec3e6edfd PY-22729 "Parameter" in highlighting settings covers only their names
Previously, it also included type annotations unless a parameter also
had a default value.
2017-10-09 14:56:50 +03:00
Mikhail Golubev e6fde8b92f PY-20401 Add highlighting for function and variable annotations 2017-10-09 14:56:50 +03:00
Mikhail Golubev 4ccdd97276 PY-11418 Add a setting in syntax highlighting for qualified calls
So far they're called "function calls" and "method calls" respectively,
though strictly speaking, these are rather "unqualified calls" and
"qualified calls" because we don't distinguish between function and
constructor calls, as well as method and qualified function calls
to avoid costs of proper resolving in the highlighting pass.
2017-10-09 14:56:50 +03:00
Mikhail Golubev e9a5faf2fb PY-11418 Allow to highlight names in call expressions 2017-10-09 14:56:50 +03:00
Mikhail Golubev baa7943629 PY-14358 Explicitly insert indent before the closing custom folding comment
that is the same as for the opening comment. Otherwise, it's impossible
to detect the necessary indentation in languages like Python, where the
block containing a comment is itself determined by this very indentation.

If it's wrong for some reason, the subsequent call of
CodeStyleManager.adjustLineIndent() should handle that in all other
languages.
2017-10-09 12:56:15 +03:00
Semyon Proshev d370ef8c36 Add ldap module -> pyldap package mapping
PY-26050 fixed.
2017-10-05 17:00:55 +03:00
Semyon Proshev 1de1fbc86f Fix considering writable property as read-only when __slots__ exist.
PY-26319 fixed.
2017-10-04 14:10:32 +03:00
Semyon Proshev 855989a8be Fix the case when abstract method could be overridden by ancestor field.
PY-26300 fixed.
2017-10-04 14:10:32 +03:00
Mikhail Golubev 7d07533771 PY-25605 EA-85878 Fix NPE: handle incomplete expressions in PyDemorganIntention 2017-10-03 17:55:31 +03:00