Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 2.17 KB

README.md

File metadata and controls

73 lines (53 loc) · 2.17 KB

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)