I'm trying to generate the docstrings to document my python functions, but when I'm going to
PyCharm
>
Settings
>
Tools
>
Python Integrated Tools
I find an empty window with no options and in particular no Docstrings
>
Docstring format
>
reStructuredText
which is what I need to configure the docs format as my colleagues.
In addition when I click on the lightbulb near the function name and click on "Insert a documentation string stub" nothing happens.
Is there a way to fix this? I'm using PyCharm 2021.1.1 (Professional Edition)
on macOS.
Press Ctrl+Alt+S and go to Editor | General |Smart Keys. Select the Insert type placeholders checkbox in the Smart Keys page of the editor settings. Place the caret at the function name, and press Alt+Enter . In the list of intention actions that opens, choose Insert documentation string stub.
Docstrings are accessible from the doc attribute (__doc__) for any of the Python objects and also with the built-in help() function. An object's docstring is defined by including a string constant as the first statement in the object's definition.
Press Ctrl+Alt+S to open the IDE settings and select Editor | General | Smart Keys. In the Enter section, select or clear Insert documentation comment stub checkbox. Then, expand the Smart Keys node and select Python. Use the Insert type placeholders in the documentation comment stub option as required.
Place the caret somewhere within the function you want to document. Press Alt+Enter to show the available intention actions. PyCharm generates documentation comment stub according to docstring format, selected in the Python Integrated Tools page.
In the Python Integrated Tools
the list in the left column that says "Nothing to show" is populated from the open Projects. In the screenshot your file/directory tree shows a .vscode
folder that isn't necessary to PyCharm, this would indicate that the PyCharm project folder called .idea
must also have been copied from your shared project.
The solution is to delete the .idea
folder and reopen PyCharm so the IDE can recreate its project folder. The reason is that the .idea
folder contains a number of absolute file paths that are different between the computers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With