Skip to content

Python#

Server#

For more information about the LSP server, check pyls.

Installation#

pip install ‘python-language-server[all]’

Debugger: Yes#

Available configurations#

lsp-clients-python-library-directories#

Default: (/usr/)

List of directories which will be considered to be libraries.


lsp-pyls-server-command#

Default: (pyls)

Command to start pyls.


lsp-pyls-configuration-sources#

Default: [pycodestyle]

List of configuration sources to use.


lsp-pyls-plugins-jedi-completion-enabled#

Default: t

Enable or disable the plugin.


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

Default: t

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


lsp-pyls-plugins-jedi-definition-enabled#

Default: t

Enable or disable the plugin.


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

Default: t

The goto call will follow imports.


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

Default: t

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


lsp-pyls-plugins-jedi-hover-enabled#

Default: t

Enable or disable the plugin.


lsp-pyls-plugins-jedi-references-enabled#

Default: t

Enable or disable the plugin.


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

Default: t

Enable or disable the plugin.


lsp-pyls-plugins-jedi-symbols-enabled#

Default: t

Enable or disable the plugin.


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

Default: t

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


lsp-pyls-plugins-mccabe-enabled#

Default: t

Enable or disable the plugin.


lsp-pyls-plugins-mccabe-threshold#

Default: 15

The minimum threshold that triggers warnings about cyclomatic complexity.


lsp-pyls-plugins-preload-enabled#

Default: t

Enable or disable the plugin.


lsp-pyls-plugins-preload-modules#

Default: nil

List of modules to import on startup


lsp-pyls-plugins-pylint-enabled#

Default: nil

Enable or disable the plugin.


lsp-pyls-plugins-pylint-args#

Default: []

Arguments, passed to pylint


lsp-pyls-plugins-pycodestyle-enabled#

Default: t

Enable or disable the plugin.


lsp-pyls-plugins-pycodestyle-exclude#

Default: nil

Exclude files or directories which match these patterns.


lsp-pyls-plugins-pycodestyle-filename#

Default: nil

When parsing directories, only check filenames matching these patterns.


lsp-pyls-plugins-pycodestyle-select#

Default: nil

Select errors and warnings


lsp-pyls-plugins-pycodestyle-ignore#

Default: nil

Ignore errors and warnings


lsp-pyls-plugins-pycodestyle-hang-closing#

Default: nil

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


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

Default: nil

Set maximum allowed line length.


lsp-pyls-plugins-pydocstyle-enabled#

Default: nil

Enable or disable the plugin.


lsp-pyls-plugins-pydocstyle-convention#

Default: nil

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


lsp-pyls-plugins-pydocstyle-add-ignore#

Default: nil

Ignore errors and warnings in addition to the specified convention.


lsp-pyls-plugins-pydocstyle-add-select#

Default: nil

Select errors and warnings in addition to the specified convention.


lsp-pyls-plugins-pydocstyle-ignore#

Default: nil

Ignore errors and warnings


lsp-pyls-plugins-pydocstyle-select#

Default: nil

Select errors and warnings


lsp-pyls-plugins-pydocstyle-match#

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

Check only files that exactly match the given regular expression; default is to match files that don’t start with ’test_’ but end with ’.py’.


lsp-pyls-plugins-pydocstyle-match-dir#

Default: [^\.].*

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


lsp-pyls-plugins-pyflakes-enabled#

Default: t

Enable or disable the plugin.


lsp-pyls-plugins-rope-completion-enabled#

Default: nil

Enable or disable the plugin.


lsp-pyls-plugins-autopep8-enabled#

Default: t

Enable or disable the plugin.


lsp-pyls-plugins-yapf-enabled#

Default: nil

Enable or disable the plugin.


lsp-pyls-rope-extension-modules#

Default: nil

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


lsp-pyls-rope-rope-folder#

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-pyls-plugins-flake8-enabled#

Default: nil

Enable or disable the plugin.


lsp-pyls-plugins-flake8-exclude#

Default: nil

List of glob patterns to exclude from checks.


lsp-pyls-plugins-flake8-filename#

Default: nil

List of glob patterns to include for checks.


lsp-pyls-plugins-flake8-hang-closing#

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-pyls-plugins-flake8-ignore#

Default: nil

A list of codes to ignore.


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

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-pyls-plugins-flake8-select#

Default: nil

Specify the list of error codes you wish Flake8 to report. Similarly to ‘lsp-pyls-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-pyls-plugins-flake8-config#

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-pyls-plugins-flake8-max-line-length’ take precedence over parameters referenced in config.


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

Default: nil

If enabled, pass the environment got by pyenv to jedi


lsp-pyls-plugins-jedi-environment#

Default: nil

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


lsp-pyls-plugins-jedi-completion-fuzzy#

Default: nil

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


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

Default: t

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

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


lsp-pyls-rename-backend#

Default: jedi

Choose renaming backend.

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



Last update: February 23, 2021