mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-27 11:08:53 +02:00
plugins/lsp/pylsp: Add python option to generate obtain the pylsp from.
Currently, pkgs.python3Packges is used by default and is unable to be changed. This stops consumers from using different/newer python versions.
This commit is contained in:
parent
100ae4027d
commit
079c2c479b
1 changed files with 479 additions and 472 deletions
|
@ -10,485 +10,492 @@ let
|
||||||
cfg = config.plugins.lsp.servers.pylsp;
|
cfg = config.plugins.lsp.servers.pylsp;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# All settings are documented here:
|
options.plugins.lsp.servers.pylsp = {
|
||||||
# https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md
|
pythonPackage = mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
options.plugins.lsp.servers.pylsp.settings = {
|
description = "Python package to use for lsp.";
|
||||||
configurationSources = mkOption {
|
default = pkgs.python3;
|
||||||
type = lib.types.nullOr (
|
|
||||||
types.enum [
|
|
||||||
"pycodestyle"
|
|
||||||
"flake8"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
description = "List of configuration sources to use.";
|
|
||||||
default = null;
|
|
||||||
apply = value: if (value != null) then [ value ] else null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
plugins = {
|
# All settings are documented here:
|
||||||
autopep8 = {
|
# https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md
|
||||||
enabled = helpers.defaultNullOpts.mkBool true ''
|
settings = {
|
||||||
Enable or disable the plugin.
|
configurationSources = mkOption {
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin (autopep8).
|
type = lib.types.nullOr (
|
||||||
'';
|
types.enum [
|
||||||
|
"pycodestyle"
|
||||||
|
"flake8"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
description = "List of configuration sources to use.";
|
||||||
|
default = null;
|
||||||
|
apply = value: if (value != null) then [ value ] else null;
|
||||||
};
|
};
|
||||||
|
|
||||||
flake8 = {
|
plugins = {
|
||||||
config = helpers.mkNullOrOption types.str ''
|
autopep8 = {
|
||||||
Path to the config file that will be the authoritative config source.
|
enabled = helpers.defaultNullOpts.mkBool true ''
|
||||||
'';
|
Enable or disable the plugin.
|
||||||
|
Setting this explicitly to `true` will install the dependency for this plugin (autopep8).
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
'';
|
||||||
Enable or disable the plugin.
|
};
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin (flake8).
|
|
||||||
'';
|
flake8 = {
|
||||||
|
config = helpers.mkNullOrOption types.str ''
|
||||||
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
Path to the config file that will be the authoritative config source.
|
||||||
List of files or directories to exclude.
|
'';
|
||||||
'';
|
|
||||||
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
executable = helpers.mkNullOrOption types.str ''
|
Enable or disable the plugin.
|
||||||
Path to the flake8 executable.
|
Setting this explicitly to `true` will install the dependency for this plugin (flake8).
|
||||||
'';
|
'';
|
||||||
|
|
||||||
filename = helpers.mkNullOrOption types.str ''
|
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
Only check for filenames matching the patterns in this list.
|
List of files or directories to exclude.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hangClosing = helpers.mkNullOrOption types.bool ''
|
executable = helpers.mkNullOrOption types.str ''
|
||||||
Hang closing bracket instead of matching indentation of opening bracket's line.
|
Path to the flake8 executable.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
filename = helpers.mkNullOrOption types.str ''
|
||||||
List of errors and warnings to ignore (or skip).
|
Only check for filenames matching the patterns in this list.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
maxComplexity = helpers.mkNullOrOption types.int ''
|
hangClosing = helpers.mkNullOrOption types.bool ''
|
||||||
Maximum allowed complexity threshold.
|
Hang closing bracket instead of matching indentation of opening bracket's line.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
maxLineLength = helpers.mkNullOrOption types.int ''
|
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
Maximum allowed line length for the entirety of this run.
|
List of errors and warnings to ignore (or skip).
|
||||||
'';
|
'';
|
||||||
|
|
||||||
indentSize = helpers.mkNullOrOption types.int ''
|
maxComplexity = helpers.mkNullOrOption types.int ''
|
||||||
Set indentation spaces.
|
Maximum allowed complexity threshold.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
perFileIgnores = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
maxLineLength = helpers.mkNullOrOption types.int ''
|
||||||
A pairing of filenames and violation codes that defines which violations to ignore in a
|
Maximum allowed line length for the entirety of this run.
|
||||||
particular file.
|
'';
|
||||||
|
|
||||||
For example: `["file_path.py:W305,W304"]`.
|
indentSize = helpers.mkNullOrOption types.int ''
|
||||||
'';
|
Set indentation spaces.
|
||||||
|
'';
|
||||||
select = helpers.mkNullOrOption (types.listOf types.str) ''
|
|
||||||
List of errors and warnings to enable.
|
perFileIgnores = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
'';
|
A pairing of filenames and violation codes that defines which violations to ignore in a
|
||||||
};
|
particular file.
|
||||||
|
|
||||||
jedi = {
|
For example: `["file_path.py:W305,W304"]`.
|
||||||
auto_import_modules = helpers.defaultNullOpts.mkListOf types.str [
|
'';
|
||||||
"numpy"
|
|
||||||
] "List of module names for `jedi.settings.auto_import_modules`.";
|
select = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||||
|
List of errors and warnings to enable.
|
||||||
extra_paths = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
'';
|
||||||
Define extra paths for jedi.Script.
|
};
|
||||||
'';
|
|
||||||
|
jedi = {
|
||||||
environment = helpers.mkNullOrOption types.str ''
|
auto_import_modules = helpers.defaultNullOpts.mkListOf types.str [
|
||||||
Define environment for jedi.Script and Jedi.names.
|
"numpy"
|
||||||
'';
|
] "List of module names for `jedi.settings.auto_import_modules`.";
|
||||||
};
|
|
||||||
|
extra_paths = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
jedi_completion = {
|
Define extra paths for jedi.Script.
|
||||||
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
'';
|
||||||
|
|
||||||
include_params = helpers.defaultNullOpts.mkBool true ''
|
environment = helpers.mkNullOrOption types.str ''
|
||||||
Auto-completes methods and classes with tabstops for each parameter.
|
Define environment for jedi.Script and Jedi.names.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
include_class_objects = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Adds class objects as a separate completion item.
|
jedi_completion = {
|
||||||
'';
|
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
||||||
|
|
||||||
include_function_objects = helpers.defaultNullOpts.mkBool false ''
|
include_params = helpers.defaultNullOpts.mkBool true ''
|
||||||
Adds function objects as a separate completion item.
|
Auto-completes methods and classes with tabstops for each parameter.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fuzzy = helpers.defaultNullOpts.mkBool false ''
|
include_class_objects = helpers.defaultNullOpts.mkBool false ''
|
||||||
Enable fuzzy when requesting autocomplete.
|
Adds class objects as a separate completion item.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
eager = helpers.defaultNullOpts.mkBool false ''
|
include_function_objects = helpers.defaultNullOpts.mkBool false ''
|
||||||
Resolve documentation and detail eagerly.
|
Adds function objects as a separate completion item.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
resolve_at_most = helpers.defaultNullOpts.mkInt 25 ''
|
fuzzy = helpers.defaultNullOpts.mkBool false ''
|
||||||
How many labels and snippets (at most) should be resolved.
|
Enable fuzzy when requesting autocomplete.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cache_for = helpers.defaultNullOpts.mkListOf types.str [
|
eager = helpers.defaultNullOpts.mkBool false ''
|
||||||
"pandas"
|
Resolve documentation and detail eagerly.
|
||||||
"numpy"
|
'';
|
||||||
"tensorflow"
|
|
||||||
"matplotlib"
|
resolve_at_most = helpers.defaultNullOpts.mkInt 25 ''
|
||||||
] "Modules for which labels and snippets should be cached.";
|
How many labels and snippets (at most) should be resolved.
|
||||||
};
|
'';
|
||||||
|
|
||||||
jedi_definition = {
|
cache_for = helpers.defaultNullOpts.mkListOf types.str [
|
||||||
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
"pandas"
|
||||||
|
"numpy"
|
||||||
follow_imports = helpers.defaultNullOpts.mkBool true ''
|
"tensorflow"
|
||||||
The goto call will follow imports.
|
"matplotlib"
|
||||||
'';
|
] "Modules for which labels and snippets should be cached.";
|
||||||
|
};
|
||||||
follow_builtin_imports = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
If follow_imports is true will decide if it follow builtin imports.
|
jedi_definition = {
|
||||||
'';
|
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
||||||
|
|
||||||
follow_builtin_definitions = helpers.defaultNullOpts.mkBool true ''
|
follow_imports = helpers.defaultNullOpts.mkBool true ''
|
||||||
Follow builtin and extension definitions to stubs.
|
The goto call will follow imports.
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
follow_builtin_imports = helpers.defaultNullOpts.mkBool true ''
|
||||||
jedi_hover = {
|
If follow_imports is true will decide if it follow builtin imports.
|
||||||
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
'';
|
||||||
};
|
|
||||||
|
follow_builtin_definitions = helpers.defaultNullOpts.mkBool true ''
|
||||||
jedi_references = {
|
Follow builtin and extension definitions to stubs.
|
||||||
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
jedi_signature_help = {
|
jedi_hover = {
|
||||||
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
||||||
};
|
};
|
||||||
|
|
||||||
jedi_symbols = {
|
jedi_references = {
|
||||||
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
||||||
|
};
|
||||||
all_scopes = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
If true lists the names of all scopes instead of only the module namespace.
|
jedi_signature_help = {
|
||||||
'';
|
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
||||||
|
};
|
||||||
include_import_symbols = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
If true includes symbols imported from other libraries.
|
jedi_symbols = {
|
||||||
'';
|
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
||||||
};
|
|
||||||
|
all_scopes = helpers.defaultNullOpts.mkBool true ''
|
||||||
mccabe = {
|
If true lists the names of all scopes instead of only the module namespace.
|
||||||
enabled = helpers.defaultNullOpts.mkBool true ''
|
'';
|
||||||
Enable or disable the plugin.
|
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin (mccabe).
|
include_import_symbols = helpers.defaultNullOpts.mkBool true ''
|
||||||
'';
|
If true includes symbols imported from other libraries.
|
||||||
|
'';
|
||||||
threshold = helpers.defaultNullOpts.mkInt 15 ''
|
};
|
||||||
The minimum threshold that triggers warnings about cyclomatic complexity.
|
|
||||||
'';
|
mccabe = {
|
||||||
};
|
enabled = helpers.defaultNullOpts.mkBool true ''
|
||||||
|
Enable or disable the plugin.
|
||||||
preload = {
|
Setting this explicitly to `true` will install the dependency for this plugin (mccabe).
|
||||||
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
'';
|
||||||
|
|
||||||
modules = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
threshold = helpers.defaultNullOpts.mkInt 15 ''
|
||||||
List of modules to import on startup.
|
The minimum threshold that triggers warnings about cyclomatic complexity.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
pycodestyle = {
|
preload = {
|
||||||
enabled = helpers.defaultNullOpts.mkBool true ''
|
enabled = helpers.defaultNullOpts.mkBool true "Enable or disable the plugin.";
|
||||||
Enable or disable the plugin.
|
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin
|
modules = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
(pycodestyle).
|
List of modules to import on startup.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
Exclude files or directories which match these patterns.
|
pycodestyle = {
|
||||||
'';
|
enabled = helpers.defaultNullOpts.mkBool true ''
|
||||||
|
Enable or disable the plugin.
|
||||||
filename = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
Setting this explicitly to `true` will install the dependency for this plugin
|
||||||
When parsing directories, only check filenames matching these patterns.
|
(pycodestyle).
|
||||||
'';
|
'';
|
||||||
|
|
||||||
ropeFolder = helpers.mkNullOrOption (types.listOf types.str) ''
|
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
Select errors and warnings.
|
Exclude files or directories which match these patterns.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
filename = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
Ignore errors and warnings.
|
When parsing directories, only check filenames matching these patterns.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hangClosing = helpers.mkNullOrOption types.bool ''
|
ropeFolder = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||||
Hang closing bracket instead of matching indentation of opening bracket's line.
|
Select errors and warnings.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
maxLineLength = helpers.mkNullOrOption types.int ''
|
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
Set maximum allowed line length.
|
Ignore errors and warnings.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
indentSize = helpers.mkNullOrOption types.int ''
|
hangClosing = helpers.mkNullOrOption types.bool ''
|
||||||
Set indentation spaces.
|
Hang closing bracket instead of matching indentation of opening bracket's line.
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
maxLineLength = helpers.mkNullOrOption types.int ''
|
||||||
pydocstyle = {
|
Set maximum allowed line length.
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
'';
|
||||||
Enable or disable the plugin.
|
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin
|
indentSize = helpers.mkNullOrOption types.int ''
|
||||||
(pydocstyle).
|
Set indentation spaces.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
convention = helpers.mkNullOrOption (types.enum [
|
|
||||||
"pep257"
|
pydocstyle = {
|
||||||
"numpy"
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
"google"
|
Enable or disable the plugin.
|
||||||
"None"
|
Setting this explicitly to `true` will install the dependency for this plugin
|
||||||
]) "Choose the basic list of checked errors by specifying an existing convention.";
|
(pydocstyle).
|
||||||
|
'';
|
||||||
addIgnore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
Ignore errors and warnings in addition to the specified convention.
|
convention = helpers.mkNullOrOption (types.enum [
|
||||||
'';
|
"pep257"
|
||||||
|
"numpy"
|
||||||
addSelect = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
"google"
|
||||||
Select errors and warnings in addition to the specified convention.
|
"None"
|
||||||
'';
|
]) "Choose the basic list of checked errors by specifying an existing convention.";
|
||||||
|
|
||||||
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
addIgnore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
Ignore errors and warnings.
|
Ignore errors and warnings in addition to the specified convention.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
select = helpers.mkNullOrOption (types.listOf types.str) ''
|
addSelect = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
Select errors and warnings.
|
Select errors and warnings in addition to the specified convention.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
match = helpers.defaultNullOpts.mkStr "(?!test_).*\\.py" ''
|
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
Check only files that exactly match the given regular expression;
|
Ignore errors and warnings.
|
||||||
default is to match files that don't start with 'test_' but end with '.py'.
|
'';
|
||||||
'';
|
|
||||||
|
select = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||||
matchDir = helpers.defaultNullOpts.mkStr "[^\\.].*" ''
|
Select errors and warnings.
|
||||||
Search only dirs that exactly match the given regular expression;
|
'';
|
||||||
default is to match dirs which do not begin with a dot.
|
|
||||||
'';
|
match = helpers.defaultNullOpts.mkStr "(?!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'.
|
||||||
pyflakes = {
|
'';
|
||||||
enabled = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Enable or disable the plugin.
|
matchDir = helpers.defaultNullOpts.mkStr "[^\\.].*" ''
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin (pyflakes).
|
Search only dirs that exactly match the given regular expression;
|
||||||
'';
|
default is to match dirs which do not begin with a dot.
|
||||||
};
|
'';
|
||||||
|
};
|
||||||
pylint = {
|
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
pyflakes = {
|
||||||
Enable or disable the plugin.
|
enabled = helpers.defaultNullOpts.mkBool true ''
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin (pylint).
|
Enable or disable the plugin.
|
||||||
'';
|
Setting this explicitly to `true` will install the dependency for this plugin (pyflakes).
|
||||||
|
'';
|
||||||
args = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
};
|
||||||
Arguments to pass to pylint.
|
|
||||||
'';
|
pylint = {
|
||||||
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
executable = helpers.mkNullOrOption types.str ''
|
Enable or disable the plugin.
|
||||||
Executable to run pylint with.
|
Setting this explicitly to `true` will install the dependency for this plugin (pylint).
|
||||||
Enabling this will run pylint on unsaved files via stdin.
|
'';
|
||||||
Can slow down workflow. Only works with python3.
|
|
||||||
'';
|
args = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
};
|
Arguments to pass to pylint.
|
||||||
|
'';
|
||||||
rope_autoimport = {
|
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
executable = helpers.mkNullOrOption types.str ''
|
||||||
Enable or disable the plugin.
|
Executable to run pylint with.
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin (rope).
|
Enabling this will run pylint on unsaved files via stdin.
|
||||||
'';
|
Can slow down workflow. Only works with python3.
|
||||||
|
'';
|
||||||
memory = helpers.defaultNullOpts.mkBool false ''
|
};
|
||||||
Make the autoimport database memory only.
|
|
||||||
Drastically increases startup time.
|
rope_autoimport = {
|
||||||
'';
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
};
|
Enable or disable the plugin.
|
||||||
|
Setting this explicitly to `true` will install the dependency for this plugin (rope).
|
||||||
rope_completion = {
|
'';
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Enable or disable the plugin.
|
memory = helpers.defaultNullOpts.mkBool false ''
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin (rope).
|
Make the autoimport database memory only.
|
||||||
'';
|
Drastically increases startup time.
|
||||||
|
'';
|
||||||
eager = helpers.defaultNullOpts.mkBool false ''
|
};
|
||||||
Resolve documentation and detail eagerly.
|
|
||||||
'';
|
rope_completion = {
|
||||||
};
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
|
Enable or disable the plugin.
|
||||||
yapf = {
|
Setting this explicitly to `true` will install the dependency for this plugin (rope).
|
||||||
enabled = helpers.defaultNullOpts.mkBool true ''
|
'';
|
||||||
Enable or disable the plugin.
|
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin (yapf).
|
eager = helpers.defaultNullOpts.mkBool false ''
|
||||||
'';
|
Resolve documentation and detail eagerly.
|
||||||
};
|
'';
|
||||||
|
};
|
||||||
### THIRD-PARTY PLUGINS
|
|
||||||
pylsp_mypy = {
|
yapf = {
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
enabled = helpers.defaultNullOpts.mkBool true ''
|
||||||
Enable or disable the plugin.
|
Enable or disable the plugin.
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin
|
Setting this explicitly to `true` will install the dependency for this plugin (yapf).
|
||||||
(pylsp-mypy).
|
'';
|
||||||
'';
|
};
|
||||||
|
|
||||||
live_mode = helpers.defaultNullOpts.mkBool true ''
|
### THIRD-PARTY PLUGINS
|
||||||
Provides type checking as you type.
|
pylsp_mypy = {
|
||||||
This writes to a tempfile every time a check is done.
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
Turning off live_mode means you must save your changes for mypy diagnostics to update
|
Enable or disable the plugin.
|
||||||
correctly.
|
Setting this explicitly to `true` will install the dependency for this plugin
|
||||||
'';
|
(pylsp-mypy).
|
||||||
|
'';
|
||||||
dmypy = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Executes via dmypy run rather than mypy.
|
live_mode = helpers.defaultNullOpts.mkBool true ''
|
||||||
This uses the dmypy daemon and may dramatically improve the responsiveness of the pylsp
|
Provides type checking as you type.
|
||||||
server, however this currently does not work in live_mode.
|
This writes to a tempfile every time a check is done.
|
||||||
Enabling this disables live_mode, even for conflicting configs.
|
Turning off live_mode means you must save your changes for mypy diagnostics to update
|
||||||
'';
|
correctly.
|
||||||
|
'';
|
||||||
strict = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Refers to the strict option of mypy.
|
dmypy = helpers.defaultNullOpts.mkBool false ''
|
||||||
This option often is too strict to be useful.
|
Executes via dmypy run rather than mypy.
|
||||||
'';
|
This uses the dmypy daemon and may dramatically improve the responsiveness of the pylsp
|
||||||
|
server, however this currently does not work in live_mode.
|
||||||
overrides = helpers.defaultNullOpts.mkListOf (with types; either bool str) [ true ] ''
|
Enabling this disables live_mode, even for conflicting configs.
|
||||||
Specifies a list of alternate or supplemental command-line options.
|
'';
|
||||||
This modifies the options passed to mypy or the mypy-specific ones passed to dmypy run.
|
|
||||||
When present, the special boolean member true is replaced with the command-line options that
|
strict = helpers.defaultNullOpts.mkBool false ''
|
||||||
would've been passed had overrides not been specified.
|
Refers to the strict option of mypy.
|
||||||
Later options take precedence, which allows for replacing or negating individual default
|
This option often is too strict to be useful.
|
||||||
options (see `mypy.main:process_options` and `mypy --help | grep inverse`).
|
'';
|
||||||
'';
|
|
||||||
|
overrides = helpers.defaultNullOpts.mkListOf (with types; either bool str) [ true ] ''
|
||||||
dmypy_status_file = helpers.defaultNullOpts.mkStr ".dmypy.json" ''
|
Specifies a list of alternate or supplemental command-line options.
|
||||||
Specifies which status file dmypy should use.
|
This modifies the options passed to mypy or the mypy-specific ones passed to dmypy run.
|
||||||
This modifies the --status-file option passed to dmypy given dmypy is active.
|
When present, the special boolean member true is replaced with the command-line options that
|
||||||
'';
|
would've been passed had overrides not been specified.
|
||||||
|
Later options take precedence, which allows for replacing or negating individual default
|
||||||
config_sub_paths = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
options (see `mypy.main:process_options` and `mypy --help | grep inverse`).
|
||||||
Specifies sub paths under which the mypy configuration file may be found.
|
'';
|
||||||
For each directory searched for the mypy config file, this also searches the sub paths
|
|
||||||
specified here.
|
dmypy_status_file = helpers.defaultNullOpts.mkStr ".dmypy.json" ''
|
||||||
'';
|
Specifies which status file dmypy should use.
|
||||||
|
This modifies the --status-file option passed to dmypy given dmypy is active.
|
||||||
report_progress = helpers.defaultNullOpts.mkBool false ''
|
'';
|
||||||
Report basic progress to the LSP client.
|
|
||||||
With this option, pylsp-mypy will report when mypy is running, given your editor supports
|
config_sub_paths = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
LSP progress reporting.
|
Specifies sub paths under which the mypy configuration file may be found.
|
||||||
For small files this might produce annoying flashing in your editor, especially in with
|
For each directory searched for the mypy config file, this also searches the sub paths
|
||||||
live_mode.
|
specified here.
|
||||||
For large projects, enabling this can be helpful to assure yourself whether mypy is still
|
'';
|
||||||
running.
|
|
||||||
'';
|
report_progress = helpers.defaultNullOpts.mkBool false ''
|
||||||
};
|
Report basic progress to the LSP client.
|
||||||
|
With this option, pylsp-mypy will report when mypy is running, given your editor supports
|
||||||
isort = {
|
LSP progress reporting.
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
For small files this might produce annoying flashing in your editor, especially in with
|
||||||
Enable or disable the plugin.
|
live_mode.
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin
|
For large projects, enabling this can be helpful to assure yourself whether mypy is still
|
||||||
(pyls-isort).
|
running.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
black = {
|
isort = {
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
Enable or disable the plugin.
|
Enable or disable the plugin.
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin
|
Setting this explicitly to `true` will install the dependency for this plugin
|
||||||
(python-lsp-black).
|
(pyls-isort).
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
cache_config = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Whether to enable black configuration caching.
|
black = {
|
||||||
'';
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
|
Enable or disable the plugin.
|
||||||
line_length = helpers.defaultNullOpts.mkInt 88 ''
|
Setting this explicitly to `true` will install the dependency for this plugin
|
||||||
An integer that maps to black's max-line-length setting.
|
(python-lsp-black).
|
||||||
Defaults to 88 (same as black's default).
|
'';
|
||||||
This can also be set through black's configuration files, which should be preferred for
|
|
||||||
multi-user projects.
|
cache_config = helpers.defaultNullOpts.mkBool false ''
|
||||||
'';
|
Whether to enable black configuration caching.
|
||||||
|
'';
|
||||||
preview = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Enable or disable black's --preview setting.
|
line_length = helpers.defaultNullOpts.mkInt 88 ''
|
||||||
'';
|
An integer that maps to black's max-line-length setting.
|
||||||
};
|
Defaults to 88 (same as black's default).
|
||||||
|
This can also be set through black's configuration files, which should be preferred for
|
||||||
memestra = {
|
multi-user projects.
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
'';
|
||||||
Enable or disable the plugin.
|
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin
|
preview = helpers.defaultNullOpts.mkBool false ''
|
||||||
(pyls-memestra).
|
Enable or disable black's --preview setting.
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
memestra = {
|
||||||
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
|
Enable or disable the plugin.
|
||||||
|
Setting this explicitly to `true` will install the dependency for this plugin
|
||||||
|
(pyls-memestra).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
rope = {
|
||||||
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
|
Enable or disable the plugin.
|
||||||
|
Setting this explicitly to `true` will install the dependency for this plugin
|
||||||
|
(pylsp-rope).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
ruff = {
|
||||||
|
enabled = helpers.defaultNullOpts.mkBool false ''
|
||||||
|
Enable or disable the plugin.
|
||||||
|
Setting this explicitly to `true` will install the dependency for this plugin
|
||||||
|
(python-lsp-ruff).
|
||||||
|
'';
|
||||||
|
|
||||||
|
config = helpers.mkNullOrOption types.str "Path to optional pyproject.toml file.";
|
||||||
|
|
||||||
|
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
|
Exclude files from being checked by ruff.
|
||||||
|
'';
|
||||||
|
|
||||||
|
executable = helpers.mkNullOrOption types.str ''
|
||||||
|
Path to the ruff executable. Assumed to be in PATH by default.
|
||||||
|
'';
|
||||||
|
|
||||||
|
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
|
Error codes to ignore.
|
||||||
|
'';
|
||||||
|
|
||||||
|
extendIgnore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
|
Same as ignore, but append to existing ignores.
|
||||||
|
'';
|
||||||
|
|
||||||
|
lineLength = helpers.mkNullOrOption types.int "Set the line-length for length checks.";
|
||||||
|
|
||||||
|
perFileIgnores = helpers.mkNullOrOption (with types; attrsOf (listOf str)) ''
|
||||||
|
File-specific error codes to be ignored.
|
||||||
|
'';
|
||||||
|
|
||||||
|
select = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
|
List of error codes to enable.
|
||||||
|
'';
|
||||||
|
|
||||||
|
extendSelect = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
|
Same as select, but append to existing error codes.
|
||||||
|
'';
|
||||||
|
|
||||||
|
format = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||||
|
List of error codes to fix during formatting.
|
||||||
|
The default is ["I"], any additional codes are appended to this list.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
### END OF THIRD-PARTY PLUGINS
|
||||||
};
|
};
|
||||||
|
|
||||||
rope = {
|
rope = {
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
extensionModules = helpers.mkNullOrOption types.str ''
|
||||||
Enable or disable the plugin.
|
Builtin and c-extension modules that are allowed to be imported and inspected by rope.
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin
|
'';
|
||||||
(pylsp-rope).
|
|
||||||
|
ropeFolder = helpers.mkNullOrOption (types.listOf types.str) ''
|
||||||
|
The name of the folder in which rope stores project configurations and data.
|
||||||
|
Pass null for not using such a folder at all.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
ruff = {
|
|
||||||
enabled = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Enable or disable the plugin.
|
|
||||||
Setting this explicitly to `true` will install the dependency for this plugin
|
|
||||||
(python-lsp-ruff).
|
|
||||||
'';
|
|
||||||
|
|
||||||
config = helpers.mkNullOrOption types.str "Path to optional pyproject.toml file.";
|
|
||||||
|
|
||||||
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
Exclude files from being checked by ruff.
|
|
||||||
'';
|
|
||||||
|
|
||||||
executable = helpers.mkNullOrOption types.str ''
|
|
||||||
Path to the ruff executable. Assumed to be in PATH by default.
|
|
||||||
'';
|
|
||||||
|
|
||||||
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
Error codes to ignore.
|
|
||||||
'';
|
|
||||||
|
|
||||||
extendIgnore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
Same as ignore, but append to existing ignores.
|
|
||||||
'';
|
|
||||||
|
|
||||||
lineLength = helpers.mkNullOrOption types.int "Set the line-length for length checks.";
|
|
||||||
|
|
||||||
perFileIgnores = helpers.mkNullOrOption (with types; attrsOf (listOf str)) ''
|
|
||||||
File-specific error codes to be ignored.
|
|
||||||
'';
|
|
||||||
|
|
||||||
select = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
List of error codes to enable.
|
|
||||||
'';
|
|
||||||
|
|
||||||
extendSelect = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
Same as select, but append to existing error codes.
|
|
||||||
'';
|
|
||||||
|
|
||||||
format = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
List of error codes to fix during formatting.
|
|
||||||
The default is ["I"], any additional codes are appended to this list.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
### END OF THIRD-PARTY PLUGINS
|
|
||||||
};
|
|
||||||
|
|
||||||
rope = {
|
|
||||||
extensionModules = helpers.mkNullOrOption types.str ''
|
|
||||||
Builtin and c-extension modules that are allowed to be imported and inspected by rope.
|
|
||||||
'';
|
|
||||||
|
|
||||||
ropeFolder = helpers.mkNullOrOption (types.listOf types.str) ''
|
|
||||||
The name of the folder in which rope stores project configurations and data.
|
|
||||||
Pass null for not using such a folder at all.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -540,7 +547,7 @@ in
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
with pkgs.python3Packages;
|
with cfg.pythonPackage.pkgs;
|
||||||
{
|
{
|
||||||
pylsp_mypy = pylsp-mypy.overridePythonAttrs (old: {
|
pylsp_mypy = pylsp-mypy.overridePythonAttrs (old: {
|
||||||
postPatch =
|
postPatch =
|
||||||
|
@ -598,7 +605,7 @@ in
|
||||||
in
|
in
|
||||||
mkDefault (
|
mkDefault (
|
||||||
# This is the final default package for pylsp
|
# This is the final default package for pylsp
|
||||||
pkgs.python3Packages.python-lsp-server.overridePythonAttrs (old: {
|
cfg.pythonPackage.pkgs.python-lsp-server.overridePythonAttrs (old: {
|
||||||
propagatedBuildInputs = pylspPlugins ++ old.dependencies;
|
propagatedBuildInputs = pylspPlugins ++ old.dependencies;
|
||||||
disabledTests = (old.disabledTests or [ ]) ++ [
|
disabledTests = (old.disabledTests or [ ]) ++ [
|
||||||
# Those tests fail when third-party plugins are loaded
|
# Those tests fail when third-party plugins are loaded
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue