Commit Graph

60 Commits

Author SHA1 Message Date
Semyon Proshev
68b17b57c0 Make return type weak for functions decorated with unknown decorator (PY-28626)
Or decorator that could change return type.
2018-03-27 21:33:54 +03:00
Mikhail Golubev
15c97cf098 PY-28808 Render empty tuple types simply as "Tuple" without brackets
so as not to produce syntactically illegal type hints. It's not clear,
though, whether we should render such types as "tuple" (not capitalized)
in other contexts, say, in Quick Documentation, as we do for built-in
collections parametrized with Any at the moment.
2018-03-05 21:22:49 +03:00
Ekaterina Tuzova
ffadc03f83 IDEA-CR-24258 check that parentheses belong to an argument list 2017-09-25 17:39:54 +03:00
Semyon Proshev
b19a95147f Rendered typevar takes much space so let's print its name only. 2017-09-22 15:52:18 +03:00
Semyon Proshev
8d877fbe29 PY-23247 Fixed: Shorten inferred type of zip function
Process overloads in PythonDocumentationProvider separately.
2017-09-22 15:52:17 +03:00
Semyon Proshev
ed3672ce40 Update PythonDocumentationProvider.describeFunction 2017-09-22 15:52:16 +03:00
Semyon Proshev
b303ed270f Update PythonDocumentationProvider.describeExpression 2017-09-22 15:52:16 +03:00
Semyon Proshev
b44cace18b Support metaclasses and six.with_metaclass in PythonDocumentationProvider.describeSuperClass 2017-09-22 15:52:16 +03:00
Semyon Proshev
952582abc5 Remove separate document link type for super class. Use link type for class instead. 2017-09-22 15:52:15 +03:00
Semyon Proshev
adddb531d8 Update describeClass method in PythonDocumentationProvider.
Now all expressions are printed and links are injected into unqualified references and subscriptions.
2017-09-22 15:52:15 +03:00
Semyon Proshev
924ed716d6 Move all documentation links processing to separate class 2017-09-22 15:52:15 +03:00
Semyon Proshev
2c536c6461 Simplify and make describing decorators methods more flexible 2017-09-22 15:52:14 +03:00
Ekaterina Tuzova
99c0e6c3f4 PY-24854 Allow Quick Documentation invocation when caret is placed inside docstring 2017-09-01 13:30:04 +03:00
Ekaterina Tuzova
048e421e55 PY-25779 Show documentation for method if caret is placed inside parameters list 2017-09-01 13:30:04 +03:00
Dmitry Trofimov
0a8aea7063 Fix test data 2017-08-07 11:18:36 +03:00
Semyon Proshev
dbff481450 Update PyDocumentationBuilder to use type evaluation context while resolving docstring owner. 2017-06-20 13:35:08 +03:00
Andrey Vlasovskikh
eb4b3dd0ca Use documentation from Python stubs for Quick Documentation view (PY-22685) 2017-03-31 20:28:39 +03:00
Mikhail Golubev
05951d275f PY-22730 Properly render Union and Optional types containing TypeVars
Namely, don't consider them "unknown" wrapping them in another
weak Union and rendering using PyType#getName() rather than
PyTypeModelBuilder.
2017-03-06 15:20:44 +03:00
Mikhail Golubev
46c229030e PY-20057 Pull up isDefinition() to PyGenericType via new PyInstantiableType interface
Additionally, I've changed rendering of type vars so that it's done in
PyTypeModelBuilder rather than in PyGenericType itself in order to
properly wrap type vars in "Type[]" before displaying them.

Moreover, it's fixed a couple of cases uncovered earlier: formatting
a type var constrained with a single upper bound and formatting a type
var constrained with some compound type, e.g. generic.
2017-03-06 15:20:44 +03:00
Semyon Proshev
75b3091a34 Update testData for PyQuickDocTest.testOptionalParameterType so mock interpreter is not used anymore 2016-12-28 14:59:09 +03:00
fitermay
aab0d3e87a PY-19826 Fixed: Generic type of list not inferred when created from tuple
Inherit PyTupleType from PyCollectionType so that getElementTypes().get(i) returns type of 'i'-th element in the tuple
2016-10-13 21:28:18 +03:00
Semyon Proshev
87f0be9f32 PY-17705 Fixed: Awkward formatting of parameter types in Quick Documentation for io.open()
Don't forget to cache type if it was converted to Optional
2016-06-17 18:40:15 +03:00
Andrey Vlasovskikh
a1d2464aa0 Parse references to assigned 'typing' expressions inside docstrings (PY-16303) 2015-10-21 17:34:12 +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
Andrey Vlasovskikh
5e8fc8c3b4 Merge branch 'vlan/pyi' 2015-09-09 11:46:04 +03:00
Ekaterina Tuzova
057c23e3f4 fixed PY-14822 Show external documentation about Python keywords
added builtin documentation for python keywords
2015-09-06 21:08:45 +03:00
Andrey Vlasovskikh
a07b4762d0 Parse "foo, optional" as Union[foo, None] as a workaround for parameters with default values (PY-15298)
It results in false negatives for optional parameters with non-None
default values, but at least we don't need to switch from stubs to AST
in the type checker inspection for every function with optional
parameters.
2015-09-02 20:22:30 +03:00
Mikhail Golubev
31e755b87a PY-4717 Detect Numpy docstring from its content 2015-09-02 14:34:25 +03:00
Ekaterina Tuzova
4eb12db5fb fixed numpy tests 2015-04-06 14:17:58 +03:00
Andrey Vlasovskikh
9a03e52441 Renamed 't1 | t2 | ...' to 'Union[t1, t2, ...]' according to PEP 484 (PY-15206) 2015-03-30 20:41:08 +03:00
Andrey Vlasovskikh
f1d939b9e4 Renamed 'unknown' to 'Any' for displaying the 'null' type (PY-15206) 2015-03-30 19:34:12 +03:00
Andrey Vlasovskikh
c93310b398 Don't resolve unqualified types in docstrings using class index (PY-12864)
It may result in false positives where our index-based guess is
incorrect.
2014-11-12 20:44:53 +03:00
Alexander Marchuk
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
Andrey Vlasovskikh
375938e79a Use '|' operator instead of 'or' for union types (PY-10423) 2013-07-30 20:20:42 +04:00
Andrey Vlasovskikh
262f51fd53 Use the type of the original element for Ctrl-Hover info (PY-10386) 2013-07-29 19:01:31 +04:00
Dmitry Trofimov
e38b35ada5 Links for function types in quickdoc (PY-3404). 2012-11-04 19:11:48 +01:00
Dmitry Trofimov
023df74d6d Links for types in quickdoc. 2012-11-04 17:28:21 +01:00
Ekaterina Tuzova
96f59f6f6a fixed test data 2012-07-23 15:14:10 +04:00
Ekaterina Tuzova
d14a19c5b8 fixed item 3 of PY-5673 Incomplete/incorrect rendering of Sphinx/rst docstrings 2012-05-05 17:25:23 +04:00
Andrey Vlasovskikh
0a23dfe269 Fixed SOE in PyDefUseUtil.getLatestDefs (EA-34435) 2012-03-23 21:29:27 +04:00
Dmitry Jemerov
3b78c94b35 improve Ctrl-hover popups, show name of function that owns the parameter (PY-4155) 2011-08-09 20:04:14 +02:00
Andrey Vlasovskikh
694dadf51a Fixed nondeterministic ordering in union types, added test data (PY-3496, CR-PY-170) 2011-08-09 21:25:15 +04:00
Andrey Vlasovskikh
e433374536 Refactored Python docstring parsing, more careful handling of formatting inside type tags 2011-07-26 21:36:11 +04:00
Andrey Vlasovskikh
e5049069cc Initial type checker inspection for Python 2011-06-15 21:21:09 +04:00
Dmitry Jemerov
19ca87905a support for class and instance attributes in Ctrl-Q 2011-05-02 19:43:12 +02:00
Dmitry Jemerov
82397ca780 show parameter description from epydoc in Ctrl-Q 2011-04-04 20:58:25 +02:00
Dmitry Jemerov
668f0a4c85 couple of fixes for docstring indentation (PY-2667) 2011-01-19 12:27:24 +01:00
Dmitry Cheryasov
07ecba288c Tests and cosmetics for quickdoc. 2010-09-13 17:07:08 +03:00
Dmitry Cheryasov
a1e52d975b Improved quickdoc tests. 2010-09-05 14:20:21 +03:00
Dmitry Cheryasov
d747f292c0 Data for updated quickdoc tests. 2010-09-03 18:10:42 +03:00