PY-16991 Don't mix up section headers and parameter references in Google docstrings
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Tue, 22 Sep 2015 13:44:02 +0000 (16:44 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Tue, 22 Sep 2015 15:44:10 +0000 (18:44 +0300)
commit4f402001ebbad9e31548025e1a4c903269518736
tree8deca75c6bdeae03fc9f8ef8ee08b08ec09022c4
parent85c2b28d97ad2c52543e25f46e6315547134f78f
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).
python/src/com/jetbrains/python/documentation/docstrings/DocStringSectionHeaderCompletionContributor.java
python/src/com/jetbrains/python/documentation/docstrings/NumpyDocString.java
python/src/com/jetbrains/python/documentation/docstrings/SectionBasedDocString.java
python/testData/completion/secondSectionNameInGoogleDocstring.py [new file with mode: 0644]
python/testData/docstrings/googleMandatoryIndentationInsideSection.py [new file with mode: 0644]
python/testSrc/com/jetbrains/python/PySectionBasedDocStringTest.java
python/testSrc/com/jetbrains/python/PythonCompletionTest.java