From 26fd7d723130edffadead54699ef35c3ea5e1ec6 Mon Sep 17 00:00:00 2001 From: Mikhail Golubev Date: Thu, 24 Sep 2015 13:54:04 +0300 Subject: [PATCH] Add javadoc for new settingsAnchor parameter of PyFunctionBuilder and PyDocstringGenerator --- .../documentation/docstrings/PyDocstringGenerator.java | 10 ++++++++++ .../jetbrains/python/psi/impl/PyFunctionBuilder.java | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/python/src/com/jetbrains/python/documentation/docstrings/PyDocstringGenerator.java b/python/src/com/jetbrains/python/documentation/docstrings/PyDocstringGenerator.java index b319b1b775d9..3bea55856ffb 100644 --- a/python/src/com/jetbrains/python/documentation/docstrings/PyDocstringGenerator.java +++ b/python/src/com/jetbrains/python/documentation/docstrings/PyDocstringGenerator.java @@ -95,6 +95,11 @@ public class PyDocstringGenerator { return new PyDocstringGenerator(owner, docStringText, DocStringUtil.getConfiguredDocStringFormat(owner), indentation, owner); } + /** + * @param settingsAnchor any PSI element, presumably in the same file/module where generated function is going to be inserted. + * It's needed to detect configured docstring format and Python indentation size and, as result, + * generate properly formatted docstring. + */ @NotNull public static PyDocstringGenerator create(@NotNull DocStringFormat format, @NotNull String indentation, @NotNull PsiElement settingsAnchor) { return new PyDocstringGenerator(null, null, format, indentation, settingsAnchor); @@ -109,6 +114,11 @@ public class PyDocstringGenerator { docString); } + /** + * @param settingsAnchor any PSI element, presumably in the same file/module where generated function is going to be inserted. + * It's needed to detect configured docstring format and Python indentation size and, as result, + * generate properly formatted docstring. + */ @NotNull public static PyDocstringGenerator update(@NotNull DocStringFormat format, @NotNull String indentation, diff --git a/python/src/com/jetbrains/python/psi/impl/PyFunctionBuilder.java b/python/src/com/jetbrains/python/psi/impl/PyFunctionBuilder.java index 9a27f2fbee2a..a3ad0223e8a5 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyFunctionBuilder.java +++ b/python/src/com/jetbrains/python/psi/impl/PyFunctionBuilder.java @@ -80,6 +80,11 @@ public class PyFunctionBuilder { myDocStringGenerator = null; } + /** + * @param settingsAnchor any PSI element, presumably in the same file/module where generated function is going to be inserted. + * It's needed to detect configured docstring format and Python indentation size and, as result, + * generate properly formatted docstring. + */ public PyFunctionBuilder(@NotNull String name, @NotNull PsiElement settingsAnchor) { myName = name; myDocStringGenerator = PyDocstringGenerator.create(DocStringUtil.getConfiguredDocStringFormat(settingsAnchor),