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

pyls_black_macchiato-0.1.3-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page