Trelent / Trelent-IntelliJ-Extension

JetBrains Plugin for Trelent
https://plugins.jetbrains.com/plugin/18716-trelent--ai-docstrings-on-demand
8 stars 1 forks source link

Python Docstring missing 1 indentation Tab #13

Open ovantur opened 1 year ago

ovantur commented 1 year ago

When using the plugin in PyCharm to docstring Python functions. The docstring generated will be missing 1 more tab for a proper view of docstring and also when generating docstring it un-indents the first line of code from the function to document being required that I indent that manually

calum-bird commented 1 year ago

Thanks for sharing this! Could you please provide a code snippet to reproduce the issue?

ovantur commented 1 year ago

Consider this init method inside a class. This is how docstring was generated and the line with super in bold is missing 1 indent

    def __init__(self, *args, **kwargs):
        """
    The __init__ function is called when the object is created.
    It sets up the initial state of the object.

    Parameters
    ----------
        self
            Represent the instance of the class
        *args
            Send a non-keyworded variable length argument list to the function
        **kwargs
            Pass a variable number of keyword arguments to a function

    Returns
    -------

        The original object

    Doc Author
    ----------
        Trelent
    """
    super(Hil, self).__init__(*args, **kwargs)
        self.__original_obj = copy.copy(self)
    How I would prefer the docstring is:
    def __init__(self, *args, **kwargs):
        """
        The __init__ function is called when the object is created.
        It sets up the initial state of the object.

        Parameters
        ----------
            self
                Represent the instance of the class
            *args
                Send a non-keyworded variable length argument list to the function
            **kwargs
                Pass a variable number of keyword arguments to a function

        Returns
        -------

            The original object

        Doc Author
        ----------
            Trelent
        """
        super(Hil, self).__init__(*args, **kwargs)
        self.__original_obj = copy.copy(self)

Anyway the missing indentation is most problematic because it generates errors and that line goes outside from function

calum-bird commented 1 year ago

Great, thank you! We're on it.

ajayjay0 commented 11 months ago

As this extension appears to no longer be supported, could you perhaps mark it as such in the marketplace?

calum-bird commented 11 months ago

@ajayjay0 What version of what IDE is it not supported for?

calum-bird commented 11 months ago

We're aware we aren't supported on 2023.2 yet. This does not mean that we do not intend to support it - just been busy.