Skip to content

Python#

Server#

For more information about the LSP server, check pylsp.

Installation#

pip install 'python-lsp-server[all]'

Debugger: Yes#

Available configurations#

lsp-clients-pylsp-library-directories#

Type: (repeat string)

Default: (/usr/)

List of directories which will be considered to be libraries.


lsp-pylsp-configuration-sources#

Type: lsp-string-vector

Default: [flake8]

List of configuration sources to use.


lsp-pylsp-plugins-autopep8-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-plugins-black-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-plugins-flake8-config#

Type: string

Default: nil

A path to a config file that will be the only config file read and used. This will cause Flake8 to ignore all other config files that exist.

NOTE: other parameters as lsp-pylsp-plugins-flake8-max-line-length take precedence over parameters referenced in config.


lsp-pylsp-plugins-flake8-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-flake8-exclude#

Type: lsp-string-vector

Default: nil

List of glob patterns to exclude from checks.


lsp-pylsp-plugins-flake8-filename#

Type: lsp-string-vector

Default: nil

List of glob patterns to include for checks.


lsp-pylsp-plugins-flake8-hang-closing#

Type: boolean

Default: nil

Toggle whether pycodestyle should enforce matching the indentation of the opening bracket`s line. When you specify this, it will prefer that you hang the closing bracket rather than match the indentation.


lsp-pylsp-plugins-flake8-ignore#

Type: lsp-string-vector

Default: nil

A list of codes to ignore.


lsp-pylsp-plugins-flake8-max-line-length#

Type: integer

Default: nil

Set the maximum length that any line (with some exceptions) may be. Exceptions include lines that are either strings or comments which are entirely URLs.


lsp-pylsp-plugins-flake8-select#

Type: lsp-string-vector

Default: nil

Specify the list of error codes you wish Flake8 to report. Similarly to lsp-pylsp-plugins-flake8-ignore. You can specify a portion of an error code to get all that start with that string. For example, you can use E, E4, E43, and E431


lsp-pylsp-plugins-isort-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-plugins-jedi-completion-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-jedi-completion-fuzzy#

Type: boolean

Default: nil

If enabled, uses fuzzy completion in jedi. Requires pylsp >= 0.32.0 Can hit performance, as well as lsp-mode implements its own fuzzy search on completion items.


lsp-pylsp-plugins-jedi-completion-include-class-objects#

Type: boolean

Default: t

If enabled, adds class objects to completion in order to avoid snippet with init args.

Has no effect if lsp-pylsp-plugins-jedi-completion-include-params is disabled. Requires pylsp >= 0.33.0


lsp-pylsp-plugins-jedi-completion-include-params#

Type: boolean

Default: t

Auto-completes methods and classes with tabstops for each parameter.


lsp-pylsp-plugins-jedi-definition-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-jedi-definition-follow-builtin-imports#

Type: boolean

Default: t

If follow_imports is True will decide if it follow builtin imports.


lsp-pylsp-plugins-jedi-definition-follow-imports#

Type: boolean

Default: t

The goto call will follow imports.


lsp-pylsp-plugins-jedi-environment#

Type: string

Default: nil

Specify the environment that jedi runs on where /bin/python should be the python executable. This option will be prioritized over lsp-pylsp-plugins-jedi-use-pyenv-environment.


lsp-pylsp-plugins-jedi-hover-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-jedi-references-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-jedi-signature-help-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-jedi-symbols-all-scopes#

Type: boolean

Default: t

If True lists the names of all scopes instead of only the module namespace.


lsp-pylsp-plugins-jedi-symbols-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-jedi-use-pyenv-environment#

Type: boolean

Default: nil

If enabled, pass the environment got by pyenv to jedi


lsp-pylsp-plugins-mccabe-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-mccabe-threshold#

Type: number

Default: 15

The minimum threshold that triggers warnings about cyclomatic complexity.


lsp-pylsp-plugins-preload-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-preload-modules#

Type: lsp-string-vector

Default: nil

List of modules to import on startup


lsp-pylsp-plugins-pycodestyle-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-plugins-pycodestyle-exclude#

Type: lsp-string-vector

Default: nil

Exclude files or directories which match these patterns.


lsp-pylsp-plugins-pycodestyle-filename#

Type: lsp-string-vector

Default: nil

When parsing directories, only check filenames matching these patterns.


lsp-pylsp-plugins-pycodestyle-hang-closing#

Type: boolean

Default: nil

Hang closing bracket instead of matching indentation of opening bracket`s line.


lsp-pylsp-plugins-pycodestyle-ignore#

Type: lsp-string-vector

Default: nil

Ignore errors and warnings


lsp-pylsp-plugins-pycodestyle-max-line-length#

Type: number

Default: nil

Set maximum allowed line length.


lsp-pylsp-plugins-pycodestyle-select#

Type: lsp-string-vector

Default: nil

Select errors and warnings


lsp-pylsp-plugins-pydocstyle-add-ignore#

Type: lsp-string-vector

Default: nil

Ignore errors and warnings in addition to the specified convention.


lsp-pylsp-plugins-pydocstyle-add-select#

Type: lsp-string-vector

Default: nil

Select errors and warnings in addition to the specified convention.


lsp-pylsp-plugins-pydocstyle-convention#

Type: (choice (:tag pep257 numpy))

Default: nil

Choose the basic list of checked errors by specifying an existing convention.


lsp-pylsp-plugins-pydocstyle-enabled#

Type: boolean

Default: t

Enable or disable the plugin.


lsp-pylsp-plugins-pydocstyle-ignore#

Type: lsp-string-vector

Default: nil

Ignore errors and warnings


lsp-pylsp-plugins-pydocstyle-match#

Type: string

Default: (?!test_).*\.py

Check only files that exactly match the given regular expression; default is to match files that dont start withtest_but end with.py`.


lsp-pylsp-plugins-pydocstyle-match-dir#

Type: string

Default: [^\.].*

Search only dirs that exactly match the given regular expression; default is to match dirs which do not begin with a dot.


lsp-pylsp-plugins-pydocstyle-select#

Type: lsp-string-vector

Default: nil

Select errors and warnings


lsp-pylsp-plugins-pyflakes-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-plugins-pylint-args#

Type: lsp-string-vector

Default: []

Arguments, passed to pylint


lsp-pylsp-plugins-pylint-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-plugins-rope-autoimport-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-plugins-rope-autoimport-memory#

Type: boolean

Default: nil

Make the autoimport database memory only.

Drastically increases startup time.


lsp-pylsp-plugins-rope-completion-eager#

Type: boolean

Default: nil

Resolve documentation and detail eagerly.


lsp-pylsp-plugins-rope-completion-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-plugins-yapf-enabled#

Type: boolean

Default: nil

Enable or disable the plugin.


lsp-pylsp-rename-backend#

Type: (choice (const :tag jedi jedi) (const :tag rope rope))

Default: jedi

Choose renaming backend.

Jedi is preferred but only works for python >= 3.6 and pylsp >= 0.32.0 Beware that Jedi is lazy and doesn`t scan the whole project. So it will rename only references it can find.


lsp-pylsp-rope-extension-modules#

Type: string

Default: nil

Builtin and c-extension modules that are allowed to be imported and inspected by rope.


lsp-pylsp-rope-rope-folder#

Type: lsp-string-vector

Default: nil

The name of the folder in which rope stores project configurations and data. Pass nil for not using such a folder at all.


lsp-pylsp-server-command#

Type: (repeat string)

Default: (pylsp)

Command to start pylsp.



Last update: September 28, 2023