1
0
Fork 0

nvim: use ruff with pyright

This commit is contained in:
Arthur K. 2026-01-30 17:56:53 +03:00
parent adc494721a
commit 5076968086
Signed by: wzray
GPG key ID: B97F30FDC4636357
3 changed files with 15 additions and 5 deletions

View file

@ -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

View file

@ -0,0 +1,7 @@
return {
settings = {
pyright = {
disableOrganizeImports = true,
},
},
}

View file

@ -2,7 +2,7 @@ return {
'neovim/nvim-lspconfig',
dependencies = {
{ 'williamboman/mason.nvim', opts = {} },
{ 'folke/neodev.nvim', opts = {}},
{ 'folke/lazydev.nvim', opts = {}},
{ 'j-hui/fidget.nvim', opts = {} },
}
}