nvim: use ruff with pyright
This commit is contained in:
parent
adc494721a
commit
5076968086
3 changed files with 15 additions and 5 deletions
|
|
@ -9,18 +9,18 @@ local servers = {
|
|||
hls = {},
|
||||
jdtls = {},
|
||||
jsonls = {},
|
||||
pyright = require('lsp.pyright'),
|
||||
kotlin_language_server = {},
|
||||
lua_ls = require('lsp.lua_ls'),
|
||||
pyright = {},
|
||||
ruff = {},
|
||||
ruby_lsp = {},
|
||||
rust_analyzer = {},
|
||||
svls = {},
|
||||
ts_ls = {},
|
||||
yamlls = require('lsp.yamlls'),
|
||||
-- codebook = {}
|
||||
}
|
||||
|
||||
vim.lsp.set_log_level('DEBUG')
|
||||
vim.lsp.set_log_level('WARN')
|
||||
|
||||
local on_attach = function(_, bufnr)
|
||||
local nmap = function(keys, func)
|
||||
|
|
@ -60,7 +60,9 @@ local on_attach = function(_, bufnr)
|
|||
nmap('<leader>F', vim.lsp.buf.format)
|
||||
end
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local capabilities = vim.tbl_deep_extend('keep', require('cmp_nvim_lsp').default_capabilities(),
|
||||
vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
capabilities.textDocument.foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true
|
||||
|
|
@ -71,5 +73,6 @@ for server_name, config in pairs(servers) do
|
|||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}, config))
|
||||
|
||||
vim.lsp.enable(server_name)
|
||||
end
|
||||
|
|
|
|||
7
.config/nvim/lua/lsp/pyright.lua
Normal file
7
.config/nvim/lua/lsp/pyright.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
settings = {
|
||||
pyright = {
|
||||
disableOrganizeImports = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue