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
ec3c403fbf
PY-16877 Complete section names in Google and Numpy docstrings
2015-09-14 22:32:52 +03:00
Mikhail Golubev
bb1039e02d
Improved detection of Python integrated tools in a new project, including docstrings format
2015-09-09 15:57:05 +03:00
Mikhail Golubev
a834c92e75
Better name for smart keys setting about type placeholder in docstring stubs
...
Also I moved all messages from PySpecificSmartKeysOptions to PyBundle.
2015-09-08 13:02:10 +03:00
Mikhail Golubev
3826afdf6c
PY-16765 In Google docstrings smart enter adds colon and indentation after section header
2015-09-07 22:01:24 +03:00
Mikhail Golubev
d0b7dee163
PY-16765 Automatically add indentation after section header in Google code style docstrings
2015-09-07 20:01:05 +03:00
Mikhail Golubev
49e3fcfd8a
Move all docstring related classes into "docstrings" subpackage
2015-09-07 17:54:54 +03:00
Mikhail Golubev
baf923eb20
Don't highlight Sphinx and Epydoc tags inside Google and Numpy docstrings
2015-09-07 17:49:29 +03:00
Mikhail Golubev
4653df951e
PY-16828 Insert docstring stub on enter even if opening quotes have e.g. unicode prefix
...
Also I removed PythonDocCommentUtil and moved its only method to PythonEnterHandler
2015-09-07 16:07:25 +03:00
Mikhail Golubev
dade15b031
Cleanup in SpecifyTypeIn*Intentions and PyDocstringInspection
...
Like SpecifyTypeInDocstringIntention SpecifyTypeInPy3AnnotationIntention
operates only on named function parameters.
2015-09-07 14:08:13 +03:00
Mikhail Golubev
c36a6673c8
PY-16761 Don't expose details of parameter naming, PyDocStringGenerator operates directly on PyParameter elements
2015-09-07 13:51:16 +03:00
Mikhail Golubev
0d8c35a8f7
PY-9795 Better docstring updates: avoid extra blank line in empty docstring and keep blank lines after last field in section
2015-09-06 02:20:14 +03:00
Mikhail Golubev
3b35da5045
PY-16761 Both StructuredDocString#getParameters and #getParameterSubstrings return names without leading '*'
2015-09-06 01:59:57 +03:00
Mikhail Golubev
3a9b03fee4
PY-16761 Handle starred parameters in docstring references, change signature and various quickfixes
2015-09-06 01:42:20 +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
3ce47a1dbb
PY-16761 Prepend vararg parameters with * in generated Google code style docstrings
2015-09-04 19:08:22 +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
d234cafc38
Quickfix that adds missing parameters in BDD step definitions inserts types in docstring
...
Finally removed method StructuredDocString#createParameterType.
2015-09-02 20:38:31 +03:00
Mikhail Golubev
3808c314c8
PyDocstringGenerator doesn't touch plain docstrings
2015-09-02 20:36:07 +03:00
Mikhail Golubev
a12ccf7aea
Annotate all method of StructuredDocString that return collections as @NotNull
...
PlainDocString returns empty lists for each of them.
2015-09-02 20:07:26 +03:00
Mikhail Golubev
9db175ab68
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.
2015-09-02 15:16:00 +03:00
Mikhail Golubev
dffddee659
PY-16766 Fix recognition of Google code style docstrings from docstring content
...
We should try all possible section headers inside docstring and confirm
Google code style once at least one of them turns out to be known.
Also I replaced predefined "\s" character group in internal regular
expressions intended for matching on single line with explicit [ \t],
because otherwise they match section headers with surrounding empty
lines.
2015-09-02 15:04:13 +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
3f34dfaa4e
PY-16762 In Google docstring use "Args" title for parameter section and section indent of 2 spaces
...
Also Numpy docstrings by default use not indented sections like
in Numpy sources.
2015-09-02 14:35:44 +03:00
Mikhail Golubev
4bae7ca3c3
PY-16656 Add test cases. Issue was fixed when enter and space handlers started to use PyDocstringGenerator
2015-09-02 14:35:42 +03:00
Mikhail Golubev
fc8ea56374
PY-16747, PY-16770 generated abstract methods preserve formatting and prefix of original docstring
2015-09-02 14:35:41 +03:00
Mikhail Golubev
9213f503e3
PY-9795 Move various indent operation on string to PyIndentUtil
2015-09-02 14:35:39 +03:00
Mikhail Golubev
8201381038
More flexible API for PyDocstringGenerator
2015-09-02 14:35:37 +03:00
Mikhail Golubev
2f14d478a6
All parameter additions made via PyDocstringGenerator respect PyCodeInsightSettings#INSERT_TYPE_DOCSTUB
2015-09-02 14:35:35 +03:00
Mikhail Golubev
f05d9dde14
Docstring parameters are removed via PyDocstringGenerator as well
2015-09-02 14:35:33 +03:00
Mikhail Golubev
a6d0b050de
PY-4717 Format Numpy docstrings via napoleon and existing rest_formatter script
2015-09-02 14:35:32 +03:00
Mikhail Golubev
596070b338
PY-9795 Remove parameters and sections with trailing empty lines if any
2015-09-02 14:35:30 +03:00
Mikhail Golubev
920a79c645
PY-9795 Better removal of multiple parameters in various kinds of docstrings
...
In particular, if several parameters were deleted via Change Signature
refactoring.
2015-09-02 14:35:28 +03:00
Mikhail Golubev
2d18cf866e
PY-9795 Properly handle insertion of multiple parameters at once
2015-09-02 14:35:26 +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
e7767c4d6e
PY-9795 Use DocStringUpdater API to remove parameters from docstring in DocstringQuickfix and other places
2015-09-02 14:35:23 +03:00
Mikhail Golubev
0eccb1b873
PY-9795 Add several tests of references in Google Code Style docstrings
2015-09-02 14:35:21 +03:00
Mikhail Golubev
f808bebed8
PY-9795 Remove redundant DocStringUpdater#scheduleUpdates
2015-09-02 14:35:19 +03:00
Mikhail Golubev
8619d3d4a5
PY-9795, PY-4717 References in section-based docstrings
2015-09-02 14:35:17 +03:00
Mikhail Golubev
973dca8315
PY-9795, PY-4717 Full-featured support of Google Code Style and Numpy docstring updates
2015-09-02 14:35:15 +03:00
Mikhail Golubev
e523ee91e4
Mostly finished updaters of Google Code Style and Numpy docstrings
...
This is probably the most tedious part of the whole process.
2015-09-02 14:35:14 +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
23e3cf2144
PY-9795, PY-4717 Add tests of docstring generation
...
Still no clear how to handle missing types in return declarations, though.
2015-09-02 14:35:10 +03:00
Mikhail Golubev
5e1666b351
Generate of Google Code Style/Numpy docstrings in various intentions and handlers
2015-09-02 14:35:08 +03:00
Mikhail Golubev
cc6490e42d
Remove redundant methods from PyDocstringGenerator
2015-09-02 14:35:06 +03:00
Mikhail Golubev
865be5f5ca
Add missing tests for insertion of docstring stubs on typing enter or space
2015-09-02 14:35:05 +03:00
Mikhail Golubev
f651eb3b14
PythonSpaceHandler uses PyDocStringGenerator. Finally get rid of PythonDocumentationProvider#generateDocumentationContentStub
2015-09-02 14:35:03 +03:00
Mikhail Golubev
50fb7947fe
Use debugger signatures and add return declarations in PyDocStringGenerator by default
2015-09-02 14:35:01 +03:00
Mikhail Golubev
0a450ae523
Streamline API of PyDocStringGenerator - remove withDefaultParameters()
2015-09-02 14:35:00 +03:00
Mikhail Golubev
b3e325357f
Fix broken tests of docstring generation on enter
2015-09-02 14:34:58 +03:00