mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-16904 Preserve none indent when updating Numpy docstring
This commit is contained in:
+1
-1
@@ -299,7 +299,7 @@ public abstract class SectionBasedDocStringUpdater extends DocStringUpdater<Sect
|
||||
protected String getFieldIndent(@NotNull Section section, @NotNull SectionField field) {
|
||||
final String titleIndent = getSectionIndent(section);
|
||||
final String fieldIndent = getLineIndent(getFieldStartLine(field));
|
||||
final int diffSize = Math.max(1, PyIndentUtil.getLineIndentSize(fieldIndent) - PyIndentUtil.getLineIndentSize(titleIndent));
|
||||
final int diffSize = Math.max(0, PyIndentUtil.getLineIndentSize(fieldIndent) - PyIndentUtil.getLineIndentSize(titleIndent));
|
||||
return StringUtil.repeatSymbol(' ', diffSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
def f(param1, param2):
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
param1
|
||||
param2 : object
|
||||
|
||||
"""
|
||||
@@ -0,0 +1,7 @@
|
||||
def <caret>f(param1, param2):
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
param2 : object
|
||||
|
||||
"""
|
||||
@@ -550,6 +550,11 @@ public class PyIntentionTest extends PyTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
// PY-16904
|
||||
public void testNumpyAddMissingParameterPreservesNoneIndent() {
|
||||
doDocAddMissingParamsTest(DocStringFormat.NUMPY);
|
||||
}
|
||||
|
||||
// PY-9795
|
||||
public void testAddMissingParamsInGoogleDocString() {
|
||||
doDocAddMissingParamsTest(DocStringFormat.GOOGLE);
|
||||
|
||||
Reference in New Issue
Block a user