forked from VimPlug/jedi
docstrings: fix "Sphinx param with type" pattern (#807)
* docstrings: fix "Sphinx param with type" pattern
Previously, the pattern only matched if the parameter description
followed on the same line, like so:
:param type foo: A param named foo.
However, it's also valid for the parameter description to be wrapped
onto the next line, like so:
:param type foo:
A param named foo.
This change updates the pattern to match the second example as well, and
adds a test to verify this behaviour.
Fixes #806.
* Add Simon Ruggier to the AUTHORS file
This commit is contained in:
committed by
Dave Halter
parent
e8718c6ce5
commit
338ea42ed9
@@ -42,6 +42,7 @@ Cristi Burcă (@scribu)
|
|||||||
bstaint (@bstaint)
|
bstaint (@bstaint)
|
||||||
Mathias Rav (@Mortal) <rav@cs.au.dk>
|
Mathias Rav (@Mortal) <rav@cs.au.dk>
|
||||||
Daniel Fiterman (@dfit99) <fitermandaniel2@gmail.com>
|
Daniel Fiterman (@dfit99) <fitermandaniel2@gmail.com>
|
||||||
|
Simon Ruggier (@sruggier)
|
||||||
|
|
||||||
|
|
||||||
Note: (@user) means a github user name.
|
Note: (@user) means a github user name.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ from jedi.evaluate.iterable import SequenceLiteralContext, FakeSequence
|
|||||||
|
|
||||||
DOCSTRING_PARAM_PATTERNS = [
|
DOCSTRING_PARAM_PATTERNS = [
|
||||||
r'\s*:type\s+%s:\s*([^\n]+)', # Sphinx
|
r'\s*:type\s+%s:\s*([^\n]+)', # Sphinx
|
||||||
r'\s*:param\s+(\w+)\s+%s:[^\n]+', # Sphinx param with type
|
r'\s*:param\s+(\w+)\s+%s:[^\n]*', # Sphinx param with type
|
||||||
r'\s*@type\s+%s:\s*([^\n]+)', # Epydoc
|
r'\s*@type\s+%s:\s*([^\n]+)', # Epydoc
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,17 @@ def sphinxy2(a, b, x):
|
|||||||
#?
|
#?
|
||||||
sphinxy2()
|
sphinxy2()
|
||||||
|
|
||||||
|
|
||||||
|
def sphinxy_param_type_wrapped(a):
|
||||||
|
"""
|
||||||
|
:param str a:
|
||||||
|
Some description wrapped onto the next line with no space after the
|
||||||
|
colon.
|
||||||
|
"""
|
||||||
|
#? str()
|
||||||
|
a
|
||||||
|
|
||||||
|
|
||||||
# local classes -> github #370
|
# local classes -> github #370
|
||||||
class ProgramNode():
|
class ProgramNode():
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user