Skip to main content

Black-macchiato plugin for the Python Language Server

Project description

Black-macchiato plugin for the Python Language Server (pyls)

To use the black code formatter with pyls, in most cases you can just use the pyls-black plugin. This plugin serves as an alternative if you need the ability to do range formatting.

Such functionality is provided by black-macchiato, while black only formats complete documents (see the black-macchiato readme for more background).

This plugin works similarly to pyls-black, but it uses the wrapping functionality from black-macchiato to enable formatting of (mostly) arbitrary ranges.

Configuration

Install this plugin into the same virtualenv as pyls. For example, on my system I am using vim-lsp and vim-lsp-settings, so I do the following:

$ ~/.local/share/vim-lsp-settings/servers/pyls/venv/bin/pip install pyls-black-macchiato

When formatting, the plugin will use logic similar to what's in black and pyls-black to search for a pyproject.toml and load its settings from there.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyls-black-macchiato-0.1.3.tar.gz (3.6 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page