Commit Graph
19 Commits
Author SHA1 Message Date
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 e28c441a73 PY-16908 Support combined parameter declarations in Numpy docstrings 2015-09-17 18:48:46 +03:00
Mikhail Golubev a1a112b959 PY-4717 If field contains type only, check that its not plain text using simple heuristic
Otherwise we can't distinguish between type and function description
in cases like the following:

Returns
-------

SomeType, optional
  value description

Continued function description.
2015-09-17 13:01:29 +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 4f7efbc3ad PY-16761 In Google code style requires section title to be capitalized, so "Args:" and "args:" don't clash 2015-09-06 01:31:49 +03:00
Mikhail Golubev feb4206ce3 Better parsing of Numpy docstring with empty section indent
Also field parsing is stricter now and it can't be parsed if parameter
name isn't valid Python identifier.

As soon as I fixed parsing of Numpy docstring format it caused errors in
multiple tests that used types of function parameters, because
previously in these places docstrings couldn't have been parsed
successfully (they were treated as Epydoc docstrings) and
PyNamedParameterImpl#getType delegated to NumpyDocStringTypeProvider.
I explicitly prohibited using of NumpyDocString for this purpose before
NumpyDocStringTypeProvider is migrated to the newer docstring API.
2015-09-03 18:57:41 +03:00
Mikhail Golubev 7a22acb8d3 PY-16758 Preserve order of sections specified in Google code style guidelines 2015-09-02 14:35:46 +03:00
Mikhail Golubev 1cb60bb8c3 PY-9795 Better removing of parameters from section-based docstrings 2015-09-02 14:35:24 +03:00
Mikhail Golubev ab4ca84665 PY-9795, PY-4717 Intention "Specify type ..." works for missing docstrings in Google and Numpy formats 2015-09-02 14:35:12 +03:00
Mikhail Golubev cfa78401a1 PY-4717 In Numpy-style docstring two empty lines in a row terminate current section
The same way Napoleon parses them.
2015-09-02 14:34:23 +03:00
Mikhail Golubev 72a3cf804d PY-9795,PY-4717 Parse Numpy-style docstrings sections and fields 2015-09-02 14:34:20 +03:00
Mikhail Golubev 524510d1a6 PY-9795 Parse optional names in "Returns" and "Yields" sections 2015-09-02 14:34:18 +03:00
Mikhail Golubev 757860a8a5 PY-9795 Parse multiline summary until first empty line of the end of docstring 2015-09-02 14:34:14 +03:00
Mikhail Golubev 31c4fe5a6b PY-9795 Strip leading indent from description of a field 2015-09-02 14:34:03 +03:00
Mikhail Golubev a096eb159d PY-9795 Handle colons in Shpinx references inside docstring as Napoleon does 2015-09-02 14:34:00 +03:00
Mikhail Golubev bf36f2aba8 PY-9795 Strip trailing empty lines in SectionBasedDocstring#parseIndentedBlock 2015-09-02 14:33:54 +03:00
Mikhail Golubev f362f0e6a2 PY-9795 First version of parsing of section-based docstrings 2015-09-02 14:33:52 +03:00