PY-895: show constructor's quickdoc on constructor call.

Also: links to classes inside method and class quickdocs.
Adds tests for property quickdocs.
This commit is contained in:
Dmitry Cheryasov
2010-09-03 18:10:12 +03:00
parent 8de992cf81
commit 86da4b3d72
23 changed files with 286 additions and 65 deletions
@@ -1 +1 @@
<html><body><code><small>class <b>Foo</b>(object)</small><br>Doc&nbsp;of&nbsp;Foo.</code></body></html>
<html><body><code>class <b>Foo</b>(<a href="psi_element://#parent#object">object</a>)<br>Doc&nbsp;of&nbsp;Foo.</code></body></html>
@@ -1 +1 @@
<html><body><code><small>class <b>Foo</b>(object)</small><br>Doc&nbsp;of&nbsp;Foo.</code></body></html>
<html><body><code><small>class <a href="psi_element://#class#">Foo</a>(<a href="psi_element://#parent#object">object</a>)</small><br><br>def <b>__init__</b>(self)</code><br><br><i>Documentation is missing.</i> The following is copied from class <code><a href="psi_element://#class#Foo">Foo</a></code>.<br><br><code>Doc&nbsp;of&nbsp;Foo.</code></body></html>
@@ -0,0 +1 @@
<html><body><code><small>class <a href="psi_element://#class#">Foo</a>(<a href="psi_element://#parent#Moo">Moo</a>)</small><br><br>def <b>__init__</b>(self)</code><br><br><i>Documentation is missing.</i> The following is copied from <code><a href="psi_element://#parent#Moo">Moo</a>.__init__</code>.<br><br><code>Doc&nbsp;of&nbsp;Moo()</code></body></html>
@@ -0,0 +1,13 @@
class Moo(object):
def __init__(self):
"Doc of Moo()"
pass
class Foo(Moo):
# no doc to inherit
def __init__(self):
# no direct doc
pass
<the_ref>Foo()
+1 -1
View File
@@ -1 +1 @@
<html><body><code><small>class <b>Foo</b>(object)</small><br>Doc&nbsp;of&nbsp;Foo.</code></body></html>
<html><body><code>class <b>Foo</b>(<a href="psi_element://#parent#object">object</a>)<br>Doc&nbsp;of&nbsp;Foo.</code></body></html>
@@ -1 +1 @@
<html><body><code><small>class B<br></small>def <b>foo</b>(self)<br>Inferred&nbsp;return&nbsp;type:&nbsp;None</code><br><br><i>Documentation is missing.</i> The following if copied from <code>A.foo</code>.<br><br><code>Doc&nbsp;from&nbsp;A.foo.</code></body></html>
<html><body><code><small>class <a href="psi_element://#class#">B</a>(<a href="psi_element://#parent#A">A</a>)</small><br><br>def <b>foo</b>(self)<br>Inferred&nbsp;return&nbsp;type:&nbsp;None</code><br><br><i>Documentation is missing.</i> The following is copied from <code><a href="psi_element://#parent#A">A</a>.foo</code>.<br><br><code>Doc&nbsp;from&nbsp;A.foo.</code></body></html>
+1 -1
View File
@@ -1 +1 @@
<html><body><code><small>class Foo<br></small>@<i>deco</i><br>def <b>meth</b>(self)<br>Inferred&nbsp;return&nbsp;type:&nbsp;None<br><br>Doc&nbsp;of&nbsp;meth.<br></code></body></html>
<html><body><code><small>class <a href="psi_element://#class#">Foo</a></small><br><br>@<i>deco</i><br>def <b>meth</b>(self)<br>Inferred&nbsp;return&nbsp;type:&nbsp;None<br><br>Doc&nbsp;of&nbsp;meth.<br></code></body></html>
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
+14
View File
@@ -0,0 +1,14 @@
class A(object):
@property
def x(self):
"Does things to X"
return 1
@x.setter
def x(self, v):
"Sets X"
self.__x = v
a = A()
a.<the_ref>x = 1
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>