coc-pydocstring
yaegassydoq (python docstring generator) extension for coc.nvim
Published Package Summary
coc-pydocstring
doq (python docstring generator) extension for coc.nvim
Install
CocInstall:
:CocInstall coc-pydocstring
vim-plug:
Plug 'yaegassy/coc-pydocstring', {'do': 'yarn install --frozen-lockfile'}
Feature
Quickly generate docstrings for python.
- Code Action
- Command
- Built-in installer
Built-in install
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.
:CocCommand pydocstring.install
Code Actions
Example key mapping (Code Action related):
nmap <silent> ga <Plug>(coc-codeaction-line)
xmap <silent> ga <Plug>(coc-codeaction-selected)
nmap <silent> gA <Plug>(coc-codeaction)
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- File-level code actions are disabled (
false) by default. - If you want to use it, set
pydocstring.enableFileActiontotruein "coc-settings.json".
- File-level code actions are disabled (
Similar plugins
- heavenshell/vim-pydocstring
- This is a vim plugin by the author of doq.
Thanks
License
MIT
This extension is built with create-coc-extension
- doq (python docstring generator) extension for coc.nvim
- onLanguage:python
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-pydocstring@0.10.0.
| Command (:CocCommand) | Description |
|---|---|
| pydocstring.install | Install doq |
| pydocstring.runFile | Run doq for file |
| pydocstring.showOutput | Show pydocstring output channel |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable coc-pydocstring extension"
}Raw JSON Schema
{
"type": "string",
"default": "",
"description": "The path to the doq tool (Absolute path)"
}Raw JSON Schema
{
"enum": [
"sphinx",
"google",
"numpy"
],
"type": "string",
"default": "sphinx",
"description": "Docstring formatter. sphinx, google or numpy"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Ignore generate docstring to `__init__` method. This option only available at `:CocCommand pydocstring.runFile`"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Ignore yield statements"
}Raw JSON Schema
{
"type": "string",
"default": "",
"description": "Path to template directory. 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`"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Ignore exception statements"
}Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Enable file-level code action"
}Raw JSON Schema
{
"type": "string",
"default": "",
"description": "Python 3.x path (Absolute path) to be used for built-in install"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Prompt the user before install"
}