Skip to content

eallender/zed-python-autodoc

Repository files navigation

Python Autodoc for Zed

Zed Extension Downloads Release

Generates PEP 257 docstrings for Python functions and classes. Type """ on the line after a definition to trigger completion.

Handles typed parameters, return types, exceptions, dataclasses, async functions, *args/**kwargs, and nested functions.

Examples

  1. Function with typed parameters

Basic Example

  1. Function with exceptions

Exception Example

  1. Dataclasses

Basic Example

  1. Complex signatures

Complex Example

More examples can be found in examples/.

PEP 257 notes:

  • Class docstrings get a summary only; __init__ parameters are documented in __init__
  • None return types are omitted
  • Raises: is only generated when the function body contains raise statements

Troubleshooting

The extension doesn't generate docstrings

  • Ensure the extension is installed and enabled.
  • Make sure the file is recognized as a Python file.

The exetension is failing to register for Python

If you've overridden the list of Python language servers in your settings.json, you'll need to include python-autodoc-lsp in the list. For example:

{
  "languages": {
    "Python": {
      "language_servers": ["...", "python-autodoc-lsp"]
    }
  }
}

License

MIT — see LICENSE.

About

Zed extension for python auto-documentation

Topics

Resources

License

Stars

4 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages