@yaegassy/coc-black-formatter
yaegassymicrosoft/vscode-black-formatter’s language server extension for coc.nvim.
Published Package Summary
coc-black-formatter
microsoft/vscode-black-formatter's langauge server extension for coc.nvim.
Install
CocInstall:
:CocInstall @yaegassy/coc-black-formatter
When using a plugin manager, etc:
e.g. vim-plug
Plug 'yaegassy/coc-black-formatter', {'do': 'yarn install --frozen-lockfile'}
Server Install
coc-black-formatter allows you to create an extension-only "venv" and install microsoft/vscode-black-formatter's langauge server.
When using coc-black-formatter for the first time, if microsoft/vscode-black-formatter's langauge server is not present in the runtime environment, you will be prompted to do a built-in install.
To use the built-in installation feature, execute the following command.
:CocCommand black-formatter.installServer
Note
When used with other coc-extensions for python that provide formatting feature
For example, coc-pyright provides a formatting feature.
If coc-black-formatter and coc-pyright are used together, the coc-pyright formatting feature should be disabled.
coc-settings.json:
{
"python.formatting.provider": "none",
}
Thanks
License
MIT
This extension is built with create-coc-extension
- microsoft/vscode-black-formatter’s language server 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 @yaegassy/coc-black-formatter@0.2.0.
| Command (:CocCommand) | Description |
|---|---|
| black-formatter.restart | Restart Server |
| black-formatter.installServer | Install Server |
| black-formatter.showOutput | Show output channel |
| black-formatter.version | Show the version of the server installed by the extension |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"markdownDescription": "Arguments passed in. Each argument is a separate string in the array."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"examples": [
[
"-m",
"black",
"~/.env/python"
],
[
"~/global_env/black"
]
],
"markdownDescription": "When set to a path to `black` binary, extension will use that for linting. NOTE: Using this option may slowdown linting."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable coc-black-formatter extension."
}Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "resource",
"default": [],
"markdownDescription": "When set to a path to python executable, extension will use that to launch the server and any subprocess."
}Raw JSON Schema
{
"enum": [
"off",
"messages",
"verbose"
],
"type": "string",
"default": "off",
"description": "Traces the communication between coc.nvim and the language server."
}Raw JSON Schema
{
"enum": [
"fromEnvironment",
"useBundled"
],
"type": "string",
"scope": "resource",
"default": "useBundled",
"markdownDescription": "Defines where `black` is imported from. This setting may be ignored if `black-formatter.path` is set.",
"markdownEnumDescriptions": [
"Use `black` from environment, fallback to bundled version only if `black` not available in the environment.",
"Always use the bundled version of `black`."
]
}Raw JSON Schema
{
"type": "string",
"default": "",
"markdownDescription": "(DEV) Set server script path."
}Raw JSON Schema
{
"enum": [
"always",
"off",
"onError",
"onWarning"
],
"type": "string",
"scope": "machine",
"default": "off",
"markdownDescription": "Controls when notifications are shown by this extension.",
"markdownEnumDescriptions": [
"Notifications are show for anything that the server chooses to show.",
"All notifications are turned off, any errors or warning are still available in the logs.",
"Notifications are shown only in the case of an error.",
"Notifications are shown for errors and warnings."
]
}Raw JSON Schema
{
"type": "string",
"default": "",
"description": "Python 3.x path (Absolute path) to be used for built-in install."
}Raw JSON Schema
{
"type": "string",
"default": "",
"markdownDescription": "(DEV) Set the python interpreter where the server is installed."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Automatically detects the black command in the execution environment and sets `black-formatter.path`."
}