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 = {}, hls = {},
jdtls = {}, jdtls = {},
jsonls = {}, jsonls = {},
pyright = require('lsp.pyright'),
kotlin_language_server = {}, kotlin_language_server = {},
lua_ls = require('lsp.lua_ls'), lua_ls = require('lsp.lua_ls'),
pyright = {}, ruff = {},
ruby_lsp = {}, ruby_lsp = {},
rust_analyzer = {}, rust_analyzer = {},
svls = {}, svls = {},
ts_ls = {}, ts_ls = {},
yamlls = require('lsp.yamlls'), yamlls = require('lsp.yamlls'),
-- codebook = {}
} }
vim.lsp.set_log_level('DEBUG') vim.lsp.set_log_level('WARN')
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)
local nmap = function(keys, func) local nmap = function(keys, func)
@ -60,7 +60,9 @@ local on_attach = function(_, bufnr)
nmap('<leader>F', vim.lsp.buf.format) nmap('<leader>F', vim.lsp.buf.format)
end 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 = { capabilities.textDocument.foldingRange = {
dynamicRegistration = false, dynamicRegistration = false,
lineFoldingOnly = true lineFoldingOnly = true
@ -71,5 +73,6 @@ for server_name, config in pairs(servers) do
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
}, config)) }, config))
vim.lsp.enable(server_name) vim.lsp.enable(server_name)
end end

View file

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

View file

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