Skip to main content

Handy code actions for python-lsp-server

Project description

PyLSP Code Actions

PyPI - Python Version Code style: black Imports: isort Code QA workflow status

Handy code actions for python-lsp-server

This is a plugin for python-lsp-server which adds a few handy code actions that I always missed:

  • Flip comma or other operand
  • Sort keyword arguments by name
  • Order keyword arguments as in the called function
  • Sort dict literal by keys
  • Generate docstring for function/method
  • Add / Remove Annotated[...] around a type annotation

Installation

Run the following command in the same venv as the server itself:

pip install pylsp-code-actions

If you are using neovim and mason, use:

:PylspInstall pylsp-code-actions

(I use neovim too btw. I also use Arch btw.)

To set up a development environment, clone the project and install it in editable mode, again in the same virtual environment as the server itself:

git clone https://github.com/DSD-DBS/pylsp-code-actions
cd pylsp-code-actions

source ~/.../pylsp-server-venv/bin/activate  # (replace with the correct path)
pip install -U pip pre-commit
pip install -e .
pre-commit install
git config commit.template .git_commit_template

Contributing

We'd love to see your bug reports and improvement suggestions! Please take a look at our guidelines for contributors for details.

Licenses

This project is compliant with the REUSE Specification Version 3.0.

Copyright DB InfraGO AG, licensed under Apache 2.0 (see full text in LICENSES/Apache-2.0.txt)

Dot-files are licensed under CC0-1.0 (see full text in LICENSES/CC0-1.0.txt)

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

pylsp_code_actions-0.1.dev1.tar.gz (19.6 kB view hashes)

Uploaded Source

Built Distribution

pylsp_code_actions-0.1.dev1-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