-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pylsp delete all text when formatting #1025
Comments
seems like an upstream error, have u check their repo yet? |
no, i don't know how to configure pylsp. |
Is it possible to specify the version of pylsp? |
You reminded me. I upgraded the latest |
The workaround is to use @nkta3m Add these lines to settings["server_formatting_block_list"] = {
pylsp = true,
}
settings["null_ls_deps"] = {
"black",
} Additionally, to use the lint function normally before -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/pylsp.lua
return {
cmd = { "pylsp" },
filetypes = { "python" },
settings = {
pylsp = {
plugins = {
-- Lint
ruff = {
enabled = false,
select = {
-- enable pycodestyle
"E",
-- enable pyflakes
"F",
},
ignore = {
-- ignore E501 (line too long)
-- "E501",
-- ignore F401 (imported but unused)
-- "F401",
},
extendSelect = { "I" },
severities = {
-- Hint, Information, Warning, Error
F401 = "I",
E501 = "I",
},
},
flake8 = { enabled = true },
pyflakes = { enabled = false },
pycodestyle = { enabled = false },
mccabe = { enabled = false },
-- Code refactor
rope = { enabled = true },
-- Formatting
black = { enabled = true },
pyls_isort = { enabled = false },
autopep8 = { enabled = false },
yapf = { enabled = false },
},
},
},
} |
Great, thanks! |
Upstream has been fixed, reinstalling the plugin will solve the problem |
Version confirmation
Following prerequisites
Not a user config issue
Neovim version
NVIM v0.9.4 Build type: Release LuaJIT 2.1.1692716794
Operating system/version
Debian
Terminal name/version
alacritty
$TERM environment variable
No response
Branch info
main (Default/Latest)
Fetch Preferences
HTTPS (use_ssh = false)
Affected language servers
pylsp
How to reproduce the issue
Actual behavior
normal format
Expected behavior
No response
Support info
Logs
[ERROR][2023-10-18 14:41:56] .../vim/lsp/rpc.lua:734 "rpc" "~/.local/share/nvim/mason/bin/pylsp" "stderr" "2023-10-18 14:41:56,891 CST - ERROR - pylsp_ruff.plugin - Error running ruff: error: unexpected argument '--format' found\n\n tip: to pass '--format' as a value, use '-- --format'\n\nUsage: ruff check <--verbose|--quiet|--silent> [FILES]...\n\nFor more information, try '--help'.\n\n"
Additional information
No response
The text was updated successfully, but these errors were encountered: