PyCharm and reStructuredText pop-up documents (Sphinx)

Suppose I want to see a docstring popup for one simple method in PyCharm 4.5 Community Edition (tested also in 5.0).

I have written these docstrings in both epytext syntax (the Epydoc generator is not supported since 2008 and only works for Python2) and the reStructuredText syntax (which is used by Sphinx - an actively maintained generator used for official python docs)

epytext one works in the PyCharm documentation, pops up fine

PyCharm works with epytext Screenshot

But reStructuredText doesn't show any parameters at all!

PyCharm error with reStructuredText screenshot

Trying to deal with this with PyCharm settings, reading PyCharm helps, looking through the PyCharm bug tracker and using Google can't help me find the reason why these docstring popups in PyCharm are not working correctly with the community recommended docstring markup language.

Is it because of the low demand for this feature? Perhaps there are some useful alternatives for viewing modern markup documentation inside PyCharm or even another IDE? I should also be able to generate HTML files with well formatted formats.

I found another thread here related to the same problem, but it has gone unanswered since last year. So, my guess is that it is wrong with my desires to view modern documentation in a modern IDE.

Here are my code examples

def find_links(self, issue, link_type):
    """

    Find all issues linked with C{issue} with C{link_type}.

    @param issue: Issue key
    @type issue: str
    @param link_type: Accepts either Type Name (like 'Child') or Link Description (like 'child of')
    @type link_type: str
    @return: Keys of found issues
    @rtype: list

    """
    result_keys = []
    link_list = self.get_link_list(issue)
    for link in link_list:
        ... # omitted
    return result_keys

def test_sphinx_docs_method(self, issue, link_type):
    """

    Find all issues linked with *issue* with *link_type*.

    :param issue: Issue key
    :type issue: str
    :param link_type: Accepts either Type Name (like 'Child') or Link Description (like 'child of')
    :type link_type: str
    :return: Keys of found issues
    :rtype: list

    """
    result_keys = []
    link_list = self.get_link_list(issue)
    for link in link_list:
        ... # omitted
    return result_keys

      

+2


source to share


1 answer


I don't know if this feature is only present in the latest versions of PyCharm, and what version do you have? In my PyCharm CE 2016.2.2 it looks like in the screenshot.

enter image description here



Check Settings> Editor> General> Code Completion to make sure the "AutoPop Documentation" option is enabled.

Good luck!

+1


source







All Articles