Commit Graph
2856 Commits
Author SHA1 Message Date
Mikhail Golubev 1b37d51740 PY-21789 Inspection about non-ASCII characters in byte strings doesn't check comments 2016-12-02 17:26:11 +03:00
Mikhail Golubev 483439720c PY-21645 Disable some inspections in function type comments 2016-12-02 17:26:11 +03:00
Semyon Proshev 2174c9b258 PY-20682 Fixed: await something() as function argument is not recognized by syntax analyzer
Copy `async` flag in ParsingScope.withSuite
2016-12-02 13:54:24 +03:00
Valentina Kiryushkina 32caddb853 PY-21707 Invalid "Unresolved reference" in multiline format strings
It's a regression introduced by fix of  PY-19842
2016-11-30 19:22:14 +03:00
Semyon Proshev cb65a7a44b Forget to filter metaclass attributes by name while resolving class type member. This bug was introduced in PY-19702-related changes. 2016-11-28 16:14:40 +03:00
Semyon Proshev a9ecefe927 PY-21474 Fixed: Type checking confused by None default argument
PyTypeAssertionEvaluator: Mark reference which is used as condition in PyConditionalExpression as non-None
2016-11-25 19:10:02 +03:00
Semyon Proshev 54a5e386f4 PY-21458 Fixed: Live template hangs PyCharm in some case
Don't analyze implicit imports while searching iterable variable for live template
2016-11-25 19:06:51 +03:00
Semyon Proshev 421655e180 PY-19723 Fixed: Type hinting of arbitrary argument lists and default argument values
Update PyTypeCheckerInspection to handle keyword arguments
2016-11-25 19:02:43 +03:00
Semyon Proshev 45e473cac8 PY-19723 Fixed: Type hinting of arbitrary argument lists and default argument values
Update PyDocStringTypeProvider to correctly handle `:type args: T1` and `:type kwargs: T2`, and wrap their types to `Tuple[T1, ...]` and `Dict[str, T2]`.
2016-11-25 19:02:42 +03:00
Mikhail Golubev 7f96674bb3 PY-21204 Quickfix "Create function" properly handles injected fragments
by inserting a new function in the containing host file, not inside the
fragment itself.

Also I fixed issues with keeping hard references to PSI elements and
usage of deprecated TemplateBuilder's API.
2016-11-25 17:45:24 +03:00
Mikhail Golubev 8c0fe707e5 PY-21204 Create a new class in host file instead of injected fragment
Additionally, I removed usages of deprecated API in CreateClassQuickFix
and utilize SmartPointer to hold the reference to PSI element.
2016-11-25 17:45:24 +03:00
Mikhail Golubev 190fe91332 PY-21563 Join "from" imports with the same origin if "Import ..." quickfix is run from type comment 2016-11-25 17:45:24 +03:00
Mikhail Golubev b01adf74ab PY-18688 Use host file when adding imports on smart completion in type comments 2016-11-25 17:45:24 +03:00
Semyon Proshev a0d7707e84 PY-21224 Fixed: False positive unresolved base method when using six.with_metaclass() and multiple inheritance
Support metaclass and several base classes in six.with_metaclass
2016-11-23 14:37:35 +03:00
Mikhail Golubev c38d178be5 PY-21220 Handle moved classes that contain both __init__ and __new__
I changed behavior of PyClassImpl#NameFinder processor, so that it
always tries to find an element with the first of the names passed to
its constructor. In particular, #findInitOrNew() returns __init__
unless there was only __new__ defined in the class. Otherwise its
behavior contradicts with the method's javadoc.
2016-11-22 17:50:21 +03:00
Mikhail Golubev 5fa7c78ebe PY-20427 Handle qualified references in the module where symbol is moved to 2016-11-22 17:50:21 +03:00
Mikhail Golubev 5c3b5e06fa PY-21292 Properly delete obsolete imports of moved symbols
Some of them might have been left if the corresponding symbols were used
and imported via "from" imports in the same module or new imports of them
were combined with some exiting "from" imports in a dependent module.
2016-11-22 17:50:21 +03:00
Mikhail Golubev d51fa3ee60 PY-21366 Consider import aliases when restoring imports for moved element 2016-11-22 17:50:21 +03:00
Elizaveta Shashkova 1338cf3f09 Tests: fix PyDynamicTypesTest
The Python side of debugger doesn't handle filename correctly when working with temp dir
2016-11-22 17:03:51 +03:00
Semyon Proshev e87b053584 PY-21350 Fixed: Wrong return type for input() in Python 3
Add skeletons for raw_input() in Python 2 and input() for both Pythons.
Update PyUserSkeletonsTypeProvider to wrap callable's return type even if it's null.
2016-11-17 20:09:32 +03:00
Semyon Proshev 01d246a444 Add forgotten test data for PyArgumentListInspectionTest.testFloatFromhex 2016-11-15 21:25:12 +03:00
Semyon Proshev 9bab826071 PY-21040 Fixed: False positive: os.popen(...).close() doesn't return anything
Update os.popen skeleton to return class which has return value in close()
2016-11-15 15:54:43 +03:00
Semyon Proshev a77aed6035 PY-20769 Fixed: Support PEP 519: File system path protocol
Update skeletons to accept PathLike objects in pathlib classes
2016-11-15 15:39:06 +03:00
Semyon Proshev 309dd061f0 Support type checking for positional arguments 2016-11-15 15:39:05 +03:00
Semyon Proshev f1a0dc0ab6 PY-20769 Fixed: Support PEP 519: File system path protocol
Update skeletons to accept PathLike objects in open and os.path functions
2016-11-15 15:39:05 +03:00
Semyon Proshev 13cc11735e PY-21083 Fixed: Inspection of float.fromhex expecting incorrect arguments
Update 'constants.py' so 'float.fromhex' stub is generated with 'staticmethod' decorator, has correct modifier and PyCallByClassInspection doesn't show any warning
2016-11-15 15:37:20 +03:00
Semyon Proshev 5c920951f0 PY-19702 Fixed: Unresolved metaclass attributes in children
In case of definition resolve attribute in metaclass definition and instance.
In case of instance check if metaclass is PyClass and look for attribute in instance attributes.
Same with completion.
2016-11-15 15:33:07 +03:00
Mikhail Golubev cece70da00 PY-21246 Properly wrap injected expressions in parentheses inside f-strings 2016-11-10 17:13:28 +03:00
Mikhail Golubev af120efee4 Split PyConvertToFStringIntention into several classes 2016-11-10 17:13:28 +03:00
Mikhail Golubev 0bc7a91716 PY-21244 Suppress intention if references for some nested fields are unresolved 2016-11-08 18:20:22 +03:00
Mikhail Golubev df4bbd4a66 PY-21244 Properly enumerate nested fields without explicit name or index
Previously they were enumerated in the opposite order, i.e.
descendant fields had lower indexes than their parents. Existing tests
didn't caught that problem because I misinterpreted the method
UsefulTestCase#assertSameElements(), should have used
UsefulTestCase#assertOrderedEquals() instead.
2016-11-08 18:20:22 +03:00
Mikhail Golubev 9ffbd3bd87 PY-21243 Suppress intention if chunks are resolved into RHS of % as a fallback
As a fallback value PySubstitutionChunkReference resolves into the
right operand of "%" operator whenever it cannot find individual
expressions for multiple positional formatted fields or a field with
a key. I explicitly check and suppress the intention for such cases.
In future it's better to introduce some sort of "strict resolve"
semantic in the PySubstitutionChunkReference so as do these checks
twice.
2016-11-08 18:20:22 +03:00
Mikhail Golubev 39a18a8cfd PY-21245 Handle quotes in lookup items inside multiline string literals better
Namely, allow lookup items that contain quotes in some cases if the
containing string literal is multiline, hence there is still a suitable
type of quotes to wrap injected string literal into.

The orignal error described in the issue has been fixed earlier as
part of other changes for PY-21161.
2016-11-08 18:20:22 +03:00
Mikhail Golubev 44744a74bd PY-21244 Fix type annotations for the built-in function "map" 2016-11-08 12:00:46 +03:00
Mikhail Golubev b71807a0a7 PY-21244 Handle nested replacement fields in "Convert to f-string" intention 2016-10-31 18:12:19 +03:00
Dmitry Trofimov d16cac767d Add test for '-m package' interpreter option in debug mode (PY-15230)
Currently -m is removed while package stays in the options. This breaks the process launch.
2016-10-30 13:05:30 +01:00
Semyon Proshev db475bb30d PY-21083 Fixed: Inspection of float.fromhex expecting incorrect arguments
Add skeleton for float.fromhex
2016-10-28 20:11:35 +03:00
Semyon Proshev 5d0cb4f64d PY-19491 Fixed: *args, **kwargs should not trigger PyUnusedLocal inspection our should be different inspection
Don't mark *args and **kwargs params in overridden __init__ as possibly unused while collecting write instructions
2016-10-27 20:50:51 +03:00
Andrey Vlasovskikh 60451cb448 PY-21088 Understand __all__.append() and __all__.extend()
PyCharm used to fail to statically evaluate __all__.append() calls in
typing.py and concluded that since __all__ was too dynamic to analyse
it was better to assume that __all__ isn't present.

It affected resolving to internal module attributes not mentioned in
__all__ and even led to false positives in unused locals when these
internal names were imported from another module right next to
star-import from the module with __all__.
2016-10-26 20:06:07 +03:00
Andrey Vlasovskikh eed34a10df PY-21133 Removed non-existent __coroutinte.__iter__ 2016-10-26 18:55:51 +03:00
Mikhail Golubev b5f9efb612 PY-21161 Don't flip quotes inside inlined expressions if it's not necessary
For instance, when inlining single-quoted string inside triple-quoted
string with the same type of quotes.
2016-10-25 21:30:13 +03:00
Mikhail Golubev a373a4d4ca PY-21161 Add tests on inlining triple-quoted strings 2016-10-25 21:30:13 +03:00
Mikhail Golubev c5f8bf51d5 PY-21161 Check that index fragment of .format() string doesn't contain backslash 2016-10-25 21:30:13 +03:00
Mikhail Golubev 7f476d1302 PY-21161 Check that index inside .format() chunk doesn't contain quotes it will be wrapped into 2016-10-25 21:30:13 +03:00
Mikhail Golubev a88719627f PY-21161 Don't suggest intention for string methods other than "format" 2016-10-25 21:30:13 +03:00
Mikhail Golubev 06286a59a2 PY-21161 Handle not-trivial format specs in printf-style formatting better 2016-10-25 21:30:13 +03:00
Mikhail Golubev 84422a7250 PY-21161 Handle subscriptions inside format string chunks like {0[foo]} 2016-10-25 21:30:13 +03:00
Mikhail Golubev 27d5095a03 PY-21161 Handle simple .format() calls (no nested fragments, no subscriptions) 2016-10-25 21:30:13 +03:00
Mikhail Golubev 2fcfcacdb7 PY-21161 Convert to f-string literal for printf-style formatting 2016-10-25 21:30:13 +03:00
Semyon Proshev 539d3058bb PY-11208 Fixed: False positive for mock.patch.object
Update PyStdlibClassMembersProvider to provide more members for unittest.mock.patch
2016-10-25 14:24:18 +03:00