Commit Graph
176 Commits
Author SHA1 Message Date
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
Semyon Proshev 05cf3e43e5 PY-21060 Fixed: Generic type hinting (PEP 484) breaks autocomplete
Update calculating class slots: if class or any ancestor doesn't have __slots__ then return null
2016-10-20 18:57:40 +03:00
Valentina Kiryushkina 6d04482ac7 PY-19839 Fix patterns for keyword substitution for print, yield, true, false keywords Add tests 2016-10-17 18:15:27 +03:00
Valentina Kiryushkina 3a2a8f142c PY-19242 Add autocompletion for % format strings
* Extract separate completion provider for formatted string arguments add patterns
* Add tests
2016-10-17 18:15:26 +03:00
Lada Gagina 4e0f092dea Add missing magic methods to PyNames and fix __rpow__ completion test 2016-08-02 20:15:37 +03:00
Semyon Proshev 893cea67b1 PY-20017 Fixed: Unresolved attributes for child class if __new__ is implemented in parent class
For 'self' and 'cls' parameters return containing class as a type
2016-08-02 16:29:59 +03:00
Semyon Proshev 58fc2f6f70 PY-19127 Fixed: __prepare__ magic function not hightlights
Add __prepare__ to py3 builtin methods
2016-05-18 21:43:45 +03:00
Andrey Vlasovskikh d009293f13 Added test for compltion of PyQt4.QtGui.QPen 2016-04-21 20:18:00 +03:00
Semyon Proshev 45b735d716 PY-18684 Fixed: incorrect auto compleat for __rpow__ method
Fix __rpow__ signature in PyNames
2016-03-23 19:23:14 +03:00
Semyon Proshev 2e2de9e48c PY-5833 Fixed: No namedtuple autocompletion if field names passed in
Try to resolve fieldNamesExpression if it is a reference
2016-02-15 19:01:21 +03:00
Semyon Proshev e5ec091587 PY-14044 Fixed: Autocomplete not working for namedtuple class constructor arguments
Add getter for namedtuple fields and use them as possible arg names for namedtuple constructor
2016-02-15 18:56:03 +03:00
Semyon Proshev 77356abd34 PY-12425 Fixed: Completion breaks when implementing a callable object with the __call__ method
Fix callType calculating for class instance: resolve __call__ member and process all possible return types
2016-02-15 16:06:48 +03:00
Ilya.Kazakevich a07a56298f support members completion for classes inherited with six.with_metaclass
* Instead of low-level expression parsing, we use type-based api.
2016-01-27 23:53:25 +03:00
Ekaterina Tuzova b3450f4df0 fixed PY-2724 Exclude protected methods from completion list if completion is performed outside a class 2016-01-13 16:52:26 +03:00
Andrey Vlasovskikh 9332b5c1cd Test for PY-17437 2015-12-16 20:18:41 +03:00
Valentina Kiryushkina 2dfb48d82a Fix problem with adding completion from star argument, make element pattern more specific, merge completion provider classes 2015-12-09 20:22:30 +03:00
Valentina Kiryushkina 4a24da8656 Add tests for authocomplete in formated arguments and formatted strings 2015-12-09 20:22:29 +03:00
Mikhail Golubev 0e887a6c6e PY-17635 Complete parameter names in ":type" declaration of reST docstrings 2015-11-16 14:32:04 +03:00
Mikhail Golubev a7e6b8b064 PY-17023 Suggest different section titles for Google and Numpy docstrings
Also I removed "Params" title, since Napoleon doesn't support it and
can't render such sections.
Titles that contain multiple words are capitalized on ever word.
Actual set of headers is based on the following user suggestion:
https://youtrack.jetbrains.com/issue/PY-9795#comment=27-1122111.
2015-09-28 15:30:38 +03:00
Mikhail Golubev 56ada7d547 PY-17002 Suggest types inside unclosed parentheses in Google docstrings 2015-09-28 15:30:37 +03:00
Mikhail Golubev 4f402001eb PY-16991 Don't mix up section headers and parameter references in Google docstrings
To avoid completion of headers instead of parameters we require at
least one space indentation inside sections in Google code style
docstrings. Thus parameters references are not inserted falsely and
we still can use the rule "if there is reference under caret don't
suggest section headers".

For Numpy we have nothing to do than to let headers be suggested
under sections (where parameters normally go), since it's not really
obvious how to distinguish incomplete parameter references from
incomplete headers there (thanks to its zero section indentation).
2015-09-22 18:44:10 +03:00
Mikhail Golubev 0ceb58b74c PY-16870, PY-16972 Complete actual name of PyClass inside docstrings, not its toString()
See com.intellij.codeInsight.completion.CompletionData#objectToLookupItem
2015-09-22 11:31:30 +03:00
Mikhail Golubev 956587f1d3 Merge branch 'east825/google-code-style-docstrings'
Conflicts:
	python/src/com/jetbrains/python/documentation/PyDocumentationBuilder.java
	python/src/com/jetbrains/python/documentation/PythonDocumentationProvider.java
	python/src/com/jetbrains/python/psi/impl/PyFunctionBuilder.java
	python/testData/quickdoc/NumPyOnesDoc.html
2015-09-15 16:13:22 +03:00
Mikhail Golubev 29a93d9145 PY-16870 Use TRIMMED_DUMMY_IDENTIFIER to complete references in docstrings
Otherwise if caret is in the middle of reference, standard dummy identifier
will break docstring format and existing references used for completion
will be lost.
For example previously line "param (int) : foo" became
"paraIntellijIdeaRulezzz m (int) : foo" and Google code style docstring
parser wasn't able to reparse it and extract necessary parameter
reference.

To use alternative dummy identifier I moved populating completion
variants from DocString*Reference classes to PyDocstringCompletionContributor.
2015-09-15 11:18:26 +03:00
Mikhail Golubev 4a73b1fa66 PY-16870 Complete parameter in Google docstring when there is no colon after them yet 2015-09-15 11:18:23 +03:00
Mikhail Golubev ec3c403fbf PY-16877 Complete section names in Google and Numpy docstrings 2015-09-14 22:32:52 +03:00
Andrey Vlasovskikh c8a8585c36 Code completion for 'async' and 'await' (PY-16094) 2015-09-08 14:22:17 +03:00
Mikhail Golubev 7d4bd2b487 PY-15197 Completion for keyword argument has spaces around '=' if required by code style settings 2015-07-31 17:50:04 +03:00
Mikhail Golubev b78e0ab785 Include "completion" directory in testDataPath of various Python completion tests
Also moved test data for PythonCompletionTest#testPy255 in its own directory
because previously it had awkwardly used whole "completion" directory as a
package.
2015-07-31 17:50:03 +03:00
Mikhail Golubev ddc77ab24c PY-15119 Completion in relative imports ignores whitespaces between dots 2015-07-31 17:50:03 +03:00
Andrey Vlasovskikh 897b896fca Added __next__() and next() special methods to class-level completion (PY-11214) 2015-05-07 19:49:45 +03:00
Andrey Vlasovskikh a77b51054b Compeltion for matrix multiplication methods (PY-15390) 2015-03-24 18:58:53 +03:00
Mikhail Golubev b0881f93f7 Remove unused PyTypeFromUsedAttributesHelper and its tests 2015-01-14 16:37:18 +03:00
Mikhail Golubev d740159214 Merge remote-tracking branch 'origin/master' into mikhail.golubev/py-attribute-inference
Conflicts:
	python/src/com/jetbrains/python/psi/impl/PyClassImpl.java
	python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java
	python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java
	python/src/com/jetbrains/python/psi/impl/references/PyQualifiedReference.java
	python/testSrc/com/jetbrains/python/PythonCompletionTest.java
	python/testSrc/com/jetbrains/python/codeInsight/PyClassMROTest.java
2014-12-25 15:32:43 +03:00
Andrey Vlasovskikh 15258248b5 Don't add untyped completion variants for structural types
They mostly duplicate each other for scopes of local functions. For
structural types we add only implicit variants obtained from a
name-based class guess.

The test data for seenMembers has been updated in order not to clash
with structural types completion.
2014-12-12 19:07:16 +03:00
Mikhail Golubev 09c1e97712 PY-14331 Do not show excluded folders in import completion 2014-11-28 16:06:26 +03:00
Andrey Vlasovskikh 5bb6011d6d Fixed completion of PyCustomMembers whose names don't match the names of resolved references (PY-14519) 2014-11-24 19:06:35 +03:00
Mikhail Golubev 3b04af366a Improve resolve/completion for package attributes (PY-14385, PY-14387, PY-14388, PY-14335)
* Outside of import statement do not suggest names of not imported
submodules for namespace packages (PY-14385). It has been done so for
normal packages (with __init__.py) already, now the same policy
applies to namespace packages.
* While searching for imported submodules, use only immediate
children of package, not arbitrary descendants (PY-14387).
* Names defined in __init__.py for indirectly imported (intermediate)
packages are included in completion list (PY-14388).
* Removed custom collecting of submodule names from PyModuleType,
use only PyModuleType#collectImportedSubmodules for this purpose.
As result duplicate undecorated entries are no longer included
in completion list for namespace packages (PY-14335).
2014-11-14 16:25:30 +03:00
Mikhail Golubev 3b0cc0de47 PY-7376 Resolving of relative imports takes into account namespace packages 2014-11-12 21:12:31 +03:00
Mikhail Golubev 2d88cbf5db Add missing test data for Py3CompletionTest.testImportNamespacePackage 2014-11-11 18:34:08 +03:00
Mikhail Golubev f5b93393fc Do not ignore import element completely if qualifier was resolved to namespace package
Consider the case when we are trying to invoke auto completion in
"import foo.bar.<caret>". Previously (mistakenly) type of
qualifier "foo.bar" was PyImportedModuleType(bar), which could not be
successfully resolved unless there is some other top-level "bar" module
under project roots. Now it's correct PyImportModuleType(foo.bar).
2014-11-11 18:34:07 +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
Mikhail Golubev 9f27d30815 Add tests for inference of function type and completion 2014-10-09 21:19:53 +04:00
Mikhail Golubev d75f031428 PY-9342 Follow assignments chain to determine that method is bound 2014-08-18 13:15:04 +04:00
Mikhail Golubev a1ae56b0f9 PY-9342 Distinguish between function and method types 2014-08-18 13:15:04 +04:00
Mikhail Golubev f506a15f9e PY-13140 Underscored names are completed inside import statement 2014-07-10 15:09:49 +04:00
Ekaterina Tuzova afd0517bb6 fixed test data 2013-11-25 20:06:29 +04:00
Ekaterina Tuzova ae50061591 fixed tests 2013-11-25 18:37:39 +04:00