Dmitry Trofimov
d89a7aee1b
Test import insertion for type annotations
2016-04-11 18:00:54 +02:00
Dmitry Trofimov
90b71d797c
Generate type annotation in comment for Python 2.x
2016-02-23 21:55:28 +01:00
Dmitry Trofimov
2697fdc568
Intention to add PEP484 Py3.5-style type annotations to a function
2016-02-22 22:38:42 +01:00
Mikhail Golubev
f42f441efc
Remove accidentally committed Bash script that was used to rename test data
2015-12-14 15:43:27 +03:00
Mikhail Golubev
baa3dfe8e6
Rename test data files for intentions to be consistent with other PyCharm tests
...
Initial text is in "<testName>.py" and expected result is in "<testName>_after.py".
Previously they were called "before<testName>.py" and "after<testName>.py" which
was very inconvenient, because these files were too far away from each other and
expected data came first.
2015-12-04 16:03:32 +03:00
Mikhail Golubev
cef43b47f6
PY-15332 Omit tags and sections for return values in docstrings for __init__ method
2015-12-04 16:03:31 +03:00
Mikhail Golubev
e674879b7f
PY-17094 Quickfix that adds Py3 return type annotation handles compound statements inside function
2015-11-09 13:51:12 +03:00
Mikhail Golubev
a955f6c927
PY-16765 For sections inside Google code style docstring use indentation configured for Python
...
PyFunctionBuilder and PyDocstringGenerator require a PSI element to
use proper formatting and style for generated docstring.
2015-09-23 18:42:17 +03:00
Mikhail Golubev
e28c441a73
PY-16908 Support combined parameter declarations in Numpy docstrings
2015-09-17 18:48:46 +03:00
Mikhail Golubev
f1d56bc8cc
PY-16904 Preserve none indent when updating Numpy docstring
2015-09-17 13:01:29 +03:00
Mikhail Golubev
afb33f77e8
Don't use "object" as fallback return type in Google and Numpy docstrings
...
Because it breaks code insight otherwise. Type "object" is not the
same thing as "Any", and the latter isn't fully supported in PyCharm
yet. As a temporary solution insert empty line under "Returns" section
instead.
2015-09-15 12:18:31 +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
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
3a9b03fee4
PY-16761 Handle starred parameters in docstring references, change signature and various quickfixes
2015-09-06 01:42:20 +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
2d18cf866e
PY-9795 Properly handle insertion of multiple parameters at once
2015-09-02 14:35:26 +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
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
7c46c74e19
Support updates of tag bases docstrings. All existing tests pass
2015-09-02 14:34:47 +03:00
Mikhail Golubev
0af842d11e
Almost finished migration to DocStringBuilder
2015-09-02 14:34:43 +03:00
Mikhail Golubev
5c4b6ceaa4
PY-15791 Force spaces around "=" sign preceding default value of annotated parameter
2015-07-16 19:15:11 +03:00
Mikhail Golubev
fdb8d23960
Proper offsets for type placeholders inside generated docstrings even if additional indentation was added
...
Formatter can insert additional indentation inside multiline string
literal to align it with surrounding statement list. It happens before
live template to edit type annotations is inserted in document, thus
offsets saved previously in PyDoctstringGenerator become invalid. From
now on PyDocstringGenerator stores line and column after first
non-whitespace character for these annotations instead and converts them
to normal offsets considering any additional indentation inserted.
2015-07-15 19:28:25 +03:00
Mikhail Golubev
150a577535
Fix test data and code style settings in tests after recent changes in formatter core
2015-07-15 19:28:25 +03:00
Mikhail Golubev
5fee1b116b
PY-16335 Preserve formatting of converted collection literals
2015-07-07 12:40:38 +03:00
Andrey Vlasovskikh
210c8c8fd5
Revert "PY-16078 Fix test data for PyConvertFormatOperatorToMethodIntentionTest"
...
This reverts commit 27a1f4c18a .
2015-06-29 20:04:07 +03:00
Mikhail Golubev
27a1f4c18a
PY-16078 Fix test data for PyConvertFormatOperatorToMethodIntentionTest
2015-06-05 15:42:34 +03:00
Mikhail Golubev
f7078d5a88
Cleanup in PyDemorganLawIntention and its tests
...
* Added missing final modifiers
* Reformat file
* Element generator is aware of language level
* Moved intention name to the bundle and properly capitalized it
* PythonDemorganLawIntentionTest extends convenient PyIntentionTestCase
and follows its conventions for test data location and naming
2015-05-25 21:37:48 +03:00
Mikhail Golubev
e187993faa
PY-9419 Add new intention action to convert between tuple, list and set literals
2015-05-25 21:37:47 +03:00
Mikhail Golubev
3971584e44
PY-8989 Support raw strings in "Convert triple-quoted to single-quoted" intention
2015-04-08 19:34:37 +03:00
Mikhail Golubev
c6662fcd15
PY-8989 More robust handling of multiline glued strings with various prefixes and quote types
2014-12-16 13:11:11 +03:00
Mikhail Golubev
adea2929d9
PY-8989 First attempt to handle multiline glued strings
...
Combine content of all glued nodes of string literal with
com.jetbrains.python.psi.PyStringLiteralExpression#getStringValueTextRanges
and then distribute them over separate lines. As a consequence any
node-specific quotes or prefixes are not preserved.
2014-12-16 13:11:11 +03:00
Mikhail Golubev
df06f2600d
PY-8989 Several improvements in PyConvertTripleQuotedStringIntention
...
* Do not replace Python-specific escape sequences with
StringUtil#escapeStringCharacter, take care of quotes only with
StringUtil#escapeChar
* Do not show intention for multiline raw strings, because we can't
insert '\n' inside them.
* Do not include empty line before closing triple quote in result, but
insert '\n' in the line before
* Do not place closing brace on its own line
2014-12-16 13:11:11 +03:00
Mikhail Golubev
13318ac8ba
PY-11074 Fix reference replacement
2014-08-29 16:38:45 +04:00
Ekaterina Tuzova
d1e989d83e
fixed test data
2014-08-27 17:01:30 +04:00
Mikhail Golubev
b1b8116a76
PY-9176 Converting % to format() doesn't handle multiline string literals
2014-07-22 13:48:03 +04:00
Ekaterina Tuzova
8bc81772e0
fixed PY-11929 Insert type assertion should be disabled for references introduced in dict comprehensions
2014-05-14 19:28:59 +04:00
Ekaterina Tuzova
4e53b58852
fixed PY-7535 Specify return type: intention is not available at the end of the function name
2014-04-03 16:35:38 +04:00
Ekaterina Tuzova
c25dd56396
fixed PY-12526 Replace with str format method call: unnecessary u prefix for python 3
2014-04-02 15:18:58 +04:00
Ekaterina Tuzova
01b776c422
extracted tests for PyConvertFormatOperatorToMethodIntention
2013-10-04 19:35:51 +04:00
Ekaterina Tuzova
fdb3742d34
PY-10989 str.format intentions don't handle unicode properly in Python 2.x
2013-10-04 19:17:53 +04:00
Ekaterina Tuzova
cb9218aff7
fixed tests
2013-06-25 12:37:03 +04:00
Ekaterina Tuzova
3e9df386aa
fixed PY-10081 Insert documentation string stub: Do not insert rst annotations when generating docstring in plain format
2013-06-24 16:30:44 +04:00
Ekaterina Tuzova
684066934e
fixed PY-9659 Convert method to property: intention should be available for methods with yeild
2013-05-11 13:10:26 +04:00
Ekaterina Tuzova
3a3f31d1b6
fixed PY-9660 Convert Method to Property: provokes Getter should return something when converting function which has return without return value
2013-05-11 13:07:35 +04:00
Ekaterina Tuzova
3d49b6001e
added convert method to property intention
2013-04-25 13:04:13 +04:00
Ekaterina Tuzova
9bc89de63f
update usages after converting static method to function
2013-04-25 13:04:12 +04:00
Ekaterina Tuzova
64668ea702
added convert static method to function intention
2013-04-24 18:12:02 +04:00
Ekaterina Tuzova
f34f661bb9
fixed tests after PY-8961 fix (formatter for py 3 parameter annotations)
2013-03-04 21:16:55 +04:00