Files
openide/python/testData/intentions/googleDocStubCustomIndent.py
Mikhail Golubev 25b35c2439 EA-75072 Fix ISE when bad indent makes inserted docstring split function body
Specifically, it may cause shift of the inserted docstring (and the
following statement) relative to the rest of the function body thus
fragmenting its block structure.
CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement() can no longer
find PyFunction element at the updated range and, thus, buildAndInsert()
returns illegal null value.

Now we use the actual indentation of a function's body both when it's
larger than what is configured in the code style settings
(PyIntentionTest.testTypeInDocstring3) and when it's smaller
(PyIntentionTest.testGoogleDocStubCustomIndent) and operate solely
on the document's level in case of new docstrings to avoid
unwanted postprocess reformatting.

I also updated some of the existing test data so that it could reproduce
the problem by including more than one statement in a function's body.
2017-07-27 13:46:47 +03:00

3 lines
47 B
Python

def <caret>f(x, y):
z = x ** y
return z