doq (python docstring generator) extension for coc.nvim
npm install coc-pydocstringdoq (python docstring generator) extension for coc.nvim

CocInstall:
``vim`
:CocInstall coc-pydocstring
vim-plug:
`vim`
Plug 'yaegassy/coc-pydocstring', {'do': 'yarn install --frozen-lockfile'}
Quickly generate docstrings for python.
- Code Action
- Command
- Built-in installer
1. pydocstring.doqPath setting
1. PATH environment (e.g. system global PATH or venv, etc ...)
1. builtin: extension-only "venv" (Installation commands are also provided)
coc-pydocstring allows you to create an extension-only "venv" and install "doq".
The first time you use coc-pydocstring, if "doq" command is not detected, you will be prompted to do a built-in installation.
You can also run the installation command manually.
`vim`
:CocCommand pydocstring.install
- pydocstring.enable: Enable coc-pydocstring extension, default: truepydocstring.doqPath
- : The path to the doq tool (Absolute path), default: ""pydocstring.builtin.pythonPath
- : Python 3.x path (Absolute path) to be used for built-in install, default: ""pydocstring.enableInstallPrompt
- : Prompt the user before install, default: truepydocstring.formatter
- : Docstring formatter (--formatter), valid options ["sphinx", "google", "numpy"], default: "sphinx"pydocstring.templatePath
- : Path to template directory (--template_path), Settings starting with / are recognized as absolute path, while others are treated as relative path from the workspace root. Additionally, both ~ and $HOME are also available and will be expanded as absolute path, default: ""pydocstring.ignoreException
- : Ignore exception statements (--ignore_exception), default: falsepydocstring.ignoreYield
- : Ignore yield statements (--ignore_yield), default: falsepydocstring.ignoreInit
- : Ignore generate docstring to __init__ method (--ignore_init). This option only available at :CocCommand pydocstring.runFile, default: falsepydocstring.enableFileAction
- : Enable file-level code action, default: false
Example key mapping (Code Action related):
`vim`
nmap
xmap
nmap
Usage:
In a "line" or "selection" containing def, async def, or class, enter the mapped key (e.g. ga) and display a list of code actions that can be performed.
- Add docstring for "Line or Selected" by pydocstringAdd docstring for "File" by pydocstring
- false
- File-level code actions are disabled () by default.pydocstring.enableFileAction
- If you want to use it, set to true in "coc-settings.json".
- pydocstring.runFile: Run doq for filepydocstring.install
- : Install doq~/.config/coc/extensions/coc-pydocstring-data/doq/venv/bin/doq
- It will be installed in this path:
- Mac/Linux: ~/AppData/Local/coc/extensions/coc-pydocstring-data/doq/venv/Scripts/doq.exe
- Windows: pydocstring.showOutput`: Show pydocstring output channel
-
- heavenshell/vim-pydocstring
- This is a vim plugin by the author of doq.
MIT
---
> This extension is built with create-coc-extension