From 931d5b6a90085e7514d43ca7ab757d4fa3bcf0a9 Mon Sep 17 00:00:00 2001 From: "Lucas F." Date: Mon, 23 Dec 2024 15:43:35 -0300 Subject: [PATCH] update: lsp pyright config --- lua/plugins/astrolsp.lua | 13 +++++++++++++ lua/plugins/mason.lua | 28 ++++++++++++++++------------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua index 86997d5..a6a1adb 100644 --- a/lua/plugins/astrolsp.lua +++ b/lua/plugins/astrolsp.lua @@ -43,6 +43,19 @@ return { ---@diagnostic disable: missing-fields config = { -- clangd = { capabilities = { offsetEncoding = "utf-8" } }, + pyright = { + settings = { + python = { + analysis = { + autoSearchPaths = true, + diagnosticMode = "workspace", + useLibraryCodeForTypes = true, + typeCheckingMode = "off", + }, + }, + }, + } + }, -- customize how language servers are attached handlers = { diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index 7941d19..0585950 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -1,24 +1,28 @@ ----@type LazySpec return { { "neovim/nvim-lspconfig", - config = function() - require("lspconfig").pyright.setup { - settings = { - python = { - analysis = { - autoSearchPaths = true, - diagnosticMode = "workspace", - useLibraryCodeForTypes = true, - typeCheckingMode = "off", - }, + dependencies = { + { + "folke/lazydev.nvim", + ft = "lua", + opts = { + library = { + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, }, }, - } + }, + }, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require "lspconfig" + lspconfig.lua_ls.setup { capabilities = capabilities } end, }, { "williamboman/mason-lspconfig.nvim", + dependencies = { + { "williamboman/mason.nvim" }, + }, opts = { ensure_installed = { "lua_ls",