Overall more reliable docstring format detection
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Wed, 2 Sep 2015 12:16:00 +0000 (15:16 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Wed, 2 Sep 2015 12:16:00 +0000 (15:16 +0300)
commit9db175ab689630b9b03425d9e73315bddd0e4704
tree6b74a2909664ab6b18f2bf2f9526baee1d9ff63e
parentdffddee65940bf71906f6a68178f5b0b150d8f33
Overall more reliable docstring format detection

I added several convenient methods for detection docstring format
in DocStringUtil. One of them - parse(String, PsiElement?) fallbacks to
docstring format specified in settings if it was unable to detect
docstring format solely from text. I replaced existing usages of
#parse(String) with this method. For PLAIN format it also returns
special PlainDocString type that can only extract summary and
description, e.g. for documentation popups.
python/src/com/jetbrains/python/documentation/DocStringReferenceProvider.java
python/src/com/jetbrains/python/documentation/DocStringUtil.java
python/src/com/jetbrains/python/documentation/PlainDocString.java [new file with mode: 0644]
python/src/com/jetbrains/python/documentation/PyDocstringGenerator.java
python/src/com/jetbrains/python/documentation/PyDocumentationBuilder.java
python/src/com/jetbrains/python/documentation/PyStructuredDocstringFormatter.java
python/src/com/jetbrains/python/documentation/PythonDocumentationProvider.java
python/src/com/jetbrains/python/inspections/PyDocstringInspection.java
python/src/com/jetbrains/python/inspections/PyDocstringTypesInspection.java
python/src/com/jetbrains/python/psi/impl/PyTargetExpressionImpl.java
python/testSrc/com/jetbrains/python/PySectionBasedDocStringTest.java