Commit Graph
2100 Commits
Author SHA1 Message Date
Andrey Vlasovskikh 12bbfd0625 Added class back to the location string of a function (PY-14205) 2014-11-10 17:11:03 +03:00
Andrey Vlasovskikh d10a06d4ff Try to update import inplace on moving its target (PY-13870)
For example, a conditional import must remain under its condition
during the refatoring.
2014-11-10 16:38:18 +03:00
Andrey Vlasovskikh cc6fdcd5c9 PY-14222 Don't allow recurive literal collection types
They used to cause infinite recursion in unpredictable places. Limiting
recursion during type inference is a bit easier to understand that doing
that during type checking.
2014-11-10 15:00:57 +03:00
Mikhail Golubev 483d9346a5 PY-11956 Check all possible canonical names if qualifier has union type
If user manually suppressed warnings about unresolved reference for
attribute of some class and this attribute is later accessed on some
expression with union type that includes this class, we should not
highlight such attribute as unresolved.
2014-11-07 14:39:31 +03:00
Mikhail Golubev 00f379ed9d PY-11357 Make automatic surrounding with custom folding comments more robust
* Searching of first parental PSI elements before/after new line
correctly stops at the start/end of file. As result it's possible now
to surround element at the first/last line in the file.
Also corresponding traversal does not try to climb above PSI file.
* Even single character can be selected in first place.
* In languages that uses indentation to delimit blocks (like Python)
several consequent sibling statements can be surrounded even if the last
of them is at the end of its parent.
2014-11-07 14:39:31 +03:00
Mikhail Golubev a32668ecd9 PY-11426 Do not warn about missing return if property was decorated as @abstractmethod/@abstractproperty 2014-11-07 11:44:29 +03:00
Andrey Vlasovskikh 20a75c4842 Fixed completion for 'from <namespace-package>.<submodule>' (PY-6477) 2014-11-06 17:07:05 +03:00
Andrey Vlasovskikh 7a41605678 Fixed completion for 'import <namespace-package>.<submodule>' (PY-5422, PY-3770, PY-10354) 2014-11-06 16:43:21 +03:00
Andrey Vlasovskikh 017bf71da6 Fixed completion for 'import <namespace-package>' (PY-7375) 2014-11-06 15:37:58 +03:00
Andrey Vlasovskikh 2d4d890e2a Extract setuptools namespace package names from *-nspkg.pth files (PY-12738, PY-13262, PY-13259) 2014-11-05 23:03:39 +03:00
Mikhail Golubev 949af74508 Add 'unittest' package to all Python mock SDKs 2014-11-05 11:17:42 +03:00
Mikhail Golubev 757d7577d3 Treat methods of base class that raise NotImplementedError as abstract 2014-11-05 11:17:42 +03:00
Mikhail Golubev a1b56a7909 PY-11127 Consider case where only class name is used in raise statment 2014-11-04 17:49:27 +03:00
Mikhail Golubev 9574f68583 PY-11127 Do not generate call of base method if it raises NotImplementedError 2014-10-31 12:39:30 +03:00
Mikhail Golubev 59c5ef46fe PY-14261 Surrounding with custom folding preserves indentation in Python 2014-10-31 12:39:29 +03:00
Mikhail Golubev 5a383961d2 PY-11357 Adjust range of PSI elements if one of them wraps another
Python does not have special terminal symbols to indicate start/end of
the block. Because of that current approach for searching boundaries for
custom folding region may result in that one of elements "felt of the
cliff" of statement list and is too far above. E.g. in sample given by
user for the last method these elements are PyFunction and PyClass.
However if exactly one element was selected by user and both elements
ends at the same offset it's safe to pick the nested one.
2014-10-31 12:39:29 +03:00
Mikhail Golubev 9795eb796b PY-13537 Allow to suppress inspection for descendants of standard classes (except builtins) 2014-10-29 20:08:20 +03:00
Mikhail Golubev 541f8ca9e6 PY-13297 Use only PSI means to insert new line after comment 2014-10-29 13:58:53 +03:00
Mikhail Golubev 71fdaee679 Include type inference for tuple multiplication in PyStdlibTypeProvider
Removed related logic from overly convoluted PyStringFormatInspection.
2014-10-29 12:55:08 +03:00
Mikhail Golubev e3faaf0442 PY-13297 Move caret on the line after inserted comment with encoding declaration
Append empty line if inserted comment is on the last line in document.
2014-10-27 13:43:16 +03:00
Mikhail Golubev 32a1e0293f PY-13686 Take set literals/comprehensions into account in PyStringFormatInspection 2014-10-24 18:28:44 +04:00
Alexander Marchuk 2bf4943091 Merge remote-tracking branch 'origin/master' 2014-10-17 20:42:42 +04:00
Ilya.Kazakevich 4b123773bb Django 1.7 Py3K fix 2014-10-17 19:25:45 +04:00
Alexander Marchuk 6ba3a88951 Merge remote-tracking branch 'origin/master' into numpy-array-view
Conflicts:
	python/testSrc/com/jetbrains/python/PyTypeTest.java
2014-10-17 15:51:56 +04:00
Andrey Vlasovskikh dfd32f7ec3 Don't analyze call to attributes present in several members of union types
It prevents false positives in checking argument types and argument
lists. We may add multiple analyze call results for this case in the
future.
2014-10-16 19:24:11 +04:00
Andrey Vlasovskikh e7f5877888 Fixed type inference for subscription operator of a union type (PY-12862) 2014-10-15 18:26:03 +04:00
Alexander Marchuk b5cfae2bde test for PY-13653 PyCharm doesn't know that arithmetic on ndarray is overloaded, infers return values to be primitive types (NumPy)
(cherry picked from commit 834126d)
2014-10-15 18:06:50 +04:00
Ilya.Kazakevich 476a39d56f Django 1.7 on Python 3 tests added 2014-10-13 22:10:30 +04:00
Mikhail Golubev 69d7a5db7c Remove unused test data 2014-10-09 12:42:03 +04:00
Mikhail Golubev 25e070c338 All-around check that operator precedence is not broken during inlining
* Add missing priorities for operators: XOR, boolean NOT and floordiv.
* Always surround ternary conditional operator in braces if it's going to be inlined
in another conditional expression for readability sake (though it does not break
semantics if we inline in the else branch).
2014-10-03 13:36:23 +04:00
Alexander MarchukandAndrey Vlasovskikh 3be9fb4c44 fix and tests for PY-8836 (false positive after ndarray and int multiplication) and PY-13422 (wrong return type in numpy.ones quickdoc)
Conflicts:
	python/testSrc/com/jetbrains/python/PyTypeTest.java
2014-10-01 18:52:18 +04:00
Mikhail Golubev 5e30498fe5 Strip spaces before/after parenthesis inside generator expression 2014-09-25 14:10:37 +04:00
Mikhail Golubev 96dd88677e PY-5475 Don't attempt to inline expression if it contains comments 2014-09-25 14:10:37 +04:00
Mikhail Golubev 27b34ba372 More rigorous check that inlining won't break operator precedence 2014-09-23 13:10:51 +04:00
Ekaterina Tuzova c091cfdf37 fixed PY-13884 "Override Methods" loses @staticmethod decorator from parent 2014-09-15 17:12:29 +04:00
Ekaterina Tuzova 33500eaee0 fixed PY-13900 g and ɡ aren't the same, so highlite the difference in the editor 2014-09-15 17:02:52 +04:00
Ekaterina Tuzova 7fd1c618c0 fixed PY-11198 Move Statement Up/Down near dictionary expression unexpectedly merges statements 2014-09-08 19:16:48 +04:00
Ekaterina Tuzova 877fae21f2 fixed PY-13868 Move statement on a comment inside a dict deletes the dict 2014-09-08 17:55:30 +04:00
Mikhail Golubev 5de0b14903 PY-12877 Fix complains found during review (IDEA-CR-397) 2014-09-08 12:47:15 +04:00
Andrey Vlasovskikh 6398722067 Reused PyHierarchyNodeDescriptor
Removed PyCallHierarchyNodeDescriptor, updated tests to include the
new presentation of tree elements.
2014-09-04 17:24:38 +04:00
Andrey Vlasovskikh 6fb1e97439 Cherry-picked static call hierarchy for Python from novokrest/intellij-idea:master 2014-09-02 19:11:57 +04:00
Ekaterina Tuzova b20442ff27 Merge remote-tracking branch 'origin/master' 2014-09-01 16:54:29 +04:00
Ekaterina Tuzova 1521e60f6a fixed PY-13809 Replace mutable default argument: renames function without body 2014-09-01 14:00:34 +04:00
Mikhail Golubev bb0c3b4cab PY-11481 Correctly detect escaped quotes at the end of string literals 2014-09-01 13:30:35 +04:00
Mikhail Golubev d96766df2d PyFormatterModelBuilder always uses PyFile as root block element
The same way FormatterModelBuilders are implemented for Java and JavaScript.
It allows to call codeStyleManager.reformat(PsiElement) directly instead of
codeStyleManager.reformatText(elt.getContainingFile(),
elt.getTextRange().getStartOffset(), elt.getTextRange().getEndOffset());
2014-08-29 16:38:45 +04:00
Mikhail Golubev 9d0ea65bdb PY-12409 Automatically reformat statements modified during "Inline local" refactoring 2014-08-29 16:38:45 +04:00
Mikhail Golubev 13318ac8ba PY-11074 Fix reference replacement 2014-08-29 16:38:45 +04:00
Ekaterina Tuzova b3bab6eb79 fixed PY-13787 Replace mutable default argument: AIOOBE at com.jetbrains.python.inspections.quickfix.PyDefaultArgumentQuickFix.applyFix 2014-08-29 12:46:58 +04:00
Mikhail Golubev c473bcd196 PY-13114 "Inline" refactoring doesn't insert redundant parenthesis 2014-08-27 17:48:09 +04:00
Ekaterina Tuzova d1e989d83e fixed test data 2014-08-27 17:01:30 +04:00