Skip to main content

Refactoring tools for python-lsp-server

Project description

pylsp-refactor

Refactoring tools for Python LSP Server

This is a plugin for Python LSP Server.

Installation

To use this plugin, you need to install this plugin in the same virtualenv as python-lsp-server itself.

pip install pylsp-refactor

Then run python-lsp-server as usual, the plugin will be auto-discovered by python-lsp-server if you've installed it to the right environment. Refer to python-lsp-server and your IDE/text editor documentation on how to setup python-lsp-server.

Features

This plugin adds the following features to pylsp:

Code Action:

  • introduce variable

Usage

Introduce variable

When CodeAction is triggered and the cursor is on a line where function call or class instantiation is presented. Makes a new variable from a function call or class instantiation and tries to guess a name for it if possible.

Additionally, it moves newly created variable out of block if it's happening somewhere inside dict initialization or class instantiation

Configuration

  • pylsp.plugins.pylsp_refactor.enabled is true by default, you can change it to false to disable plugin completely

Caveat

This plugin is in early development, so expect some bugs. Please report in Issue tracker if you had any issues with the plugin

Developing

See CONTRIBUTING.md

Credits

This package was created with Cookiecutter from python-lsp/cookiecutter-pylsp-plugin project template.

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_refactor-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

pylsp_refactor-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file pylsp_refactor-0.1.0.tar.gz.

File metadata

  • Download URL: pylsp_refactor-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for pylsp_refactor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6819b1b9f132de7480a2a71ca31cc502842d5d65b31bcbebcb5b2927d3ee8c5
MD5 593e22c606f0548425365ca1a18d912e
BLAKE2b-256 b3d14dbc72e29b68a035ec68722be58345906f07907a0fe7fbce0c9a3a0a697a

See more details on using hashes here.

File details

Details for the file pylsp_refactor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pylsp_refactor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for pylsp_refactor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd635698cd248c95f5fbbfc2c11fa2411abb94b7b93e96a935444be767547000
MD5 0e4f7060020b5475d6dcb5e42f49bb02
BLAKE2b-256 92e6d5fe5c12e9fbcf6668af8152bcc5a6188dd37c64f02e6511c60d51881b82

See more details on using hashes here.

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