diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2024-04-09 10:49:10 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2024-04-09 10:49:10 -0600 |
commit | a70c1ac9c065c0c5c19227b6952dc579a2b6cecd (patch) | |
tree | 8d7312a4be5f805df521262e17812367cae19455 /lua/plugins | |
parent | 9394f1243425db00825b10091648bbd2c1f83d01 (diff) |
fix: python ruff/pyright
Diffstat (limited to 'lua/plugins')
-rw-r--r-- | lua/plugins/lspconfig.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index bd6f4c5..bcbe84e 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -44,7 +44,18 @@ local servers = { } } }, - pyright = {}, + pyright = { + pyright = { + -- Using Ruff's import organizer + disableOrganizeImports = true, + }, + python = { + analysis = { + -- Ignore all files for analysis to exclusively use Ruff for linting + ignore = { '*' }, + }, + }, + }, lua_ls = { Lua = { telemetry = { enable = false }, @@ -104,7 +115,11 @@ return { capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) -- TODO: change keybinds to the autocmd suggested by the lspconfig github - local on_attach = function(_, bufnr) -- _ is client + local on_attach = function(client, bufnr) + if client.name == 'ruff_lsp' then + -- Disable hover in favor of Pyright + client.server_capabilities.hoverProvider = false + end -- Create a command `:Format` local to the LSP buffer vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) vim.lsp.buf.format({ async = false }) |