Better parsing of Numpy docstring with empty section indent
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Thu, 3 Sep 2015 13:55:06 +0000 (16:55 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Thu, 3 Sep 2015 15:57:41 +0000 (18:57 +0300)
commitfeb4206ce32411d6079b5dbbf9bddd1b4e1ffccb
tree1e8110b6c3b575daab64c006961ccf656a0e9daf
parentd234cafc38e4949722e289724189bc8624a2cb02
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.
python/src/com/jetbrains/python/documentation/DocStringLineParser.java
python/src/com/jetbrains/python/documentation/GoogleCodeStyleDocString.java
python/src/com/jetbrains/python/documentation/NumpyDocString.java
python/src/com/jetbrains/python/documentation/PlainDocString.java
python/src/com/jetbrains/python/documentation/SectionBasedDocString.java
python/src/com/jetbrains/python/documentation/docstrings/DocStringUpdater.java
python/src/com/jetbrains/python/documentation/docstrings/TagBasedDocStringUpdater.java
python/src/com/jetbrains/python/psi/impl/PyNamedParameterImpl.java
python/testData/docstrings/numpyEmptySectionIndent.py [new file with mode: 0644]
python/testSrc/com/jetbrains/python/PySectionBasedDocStringTest.java