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 = {},
|
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
|
||||||
|
|
|
||||||
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -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 = {} },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue