]> git.rmz.io Git - dotfiles.git/blob - nvim/lua/plugins/lang/python.lua
nvim: remove unnecessary python lsp server config
[dotfiles.git] / nvim / lua / plugins / lang / python.lua
1 return {
2 { "nvim-treesitter/nvim-treesitter",
3 opts = { ensure_installed = { "ninja", "rst" } },
4 },
5 { "neovim/nvim-lspconfig",
6 opts = {
7 servers = {
8 ruff = {
9 cmd_env = { RUFF_TRACE = "messages" },
10 init_options = {
11 settings = {
12 logLevel = "error",
13 },
14 },
15 keys = {
16 {
17 "<leader>co",
18 rmz.lsp.action["source.organizeImports"],
19 desc = "Organize Imports",
20 },
21 },
22 },
23 },
24 setup = {
25 ["ruff"] = function()
26 rmz.lsp.on_attach(function(client, _)
27 -- Disable hover in favor of Pyright
28 client.server_capabilities.hoverProvider = false
29 end, "ruff")
30 end,
31 },
32 },
33 },
34 {
35 "nvim-neotest/neotest",
36 dependencies = {
37 "nvim-neotest/neotest-python",
38 },
39 opts = {
40 adapters = {
41 ["neotest-python"] = {
42 dap = { justMyCode = false }},
43 },
44 },
45 },
46 {
47 "mfussenegger/nvim-dap",
48 dependencies = {
49 "mfussenegger/nvim-dap-python",
50 keys = {
51 { "<leader>dPt", function() require('dap-python').test_method() end, desc = "Debug Method", ft = "python" },
52 { "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
53 },
54 config = function()
55 local path = require("mason-registry").get_package("debugpy"):get_install_path()
56 require("dap-python").setup(path .. "/venv/bin/python")
57 end,
58 },
59 },
60 { "jay-babu/mason-nvim-dap.nvim",
61 opts = {
62 handlers = {
63 python = function() end,
64 },
65 ensure_installed = { "python" },
66 },
67 },
68 { "linux-cultist/venv-selector.nvim", enabled = false,
69 -- TODO needs fd to be installed (I don't know what that is)
70 branch = "regexp", -- Use this branch for the new version
71 cmd = "VenvSelect",
72 opts = {
73 settings = {
74 options = {
75 notify_user_on_venv_activation = true,
76 },
77 },
78 },
79 -- Call config for python files and load the cached venv automatically
80 ft = "python",
81 keys = { { "<leader>cv", "<cmd>:VenvSelect<cr>", desc = "Select VirtualEnv", ft = "python" } },
82 },
83 { "hrsh7th/nvim-cmp",
84 optional = true,
85 opts = function(_, opts)
86 opts.auto_brackets = opts.auto_brackets or {}
87 table.insert(opts.auto_brackets, "python")
88 end,
89 },
90 }