Browse Source

update: lsp pyright config

master
Lucas 4 months ago
parent
commit
931d5b6a90
  1. 13
      lua/plugins/astrolsp.lua
  2. 26
      lua/plugins/mason.lua

13
lua/plugins/astrolsp.lua

@ -43,6 +43,19 @@ return {
---@diagnostic disable: missing-fields ---@diagnostic disable: missing-fields
config = { config = {
-- clangd = { capabilities = { offsetEncoding = "utf-8" } }, -- clangd = { capabilities = { offsetEncoding = "utf-8" } },
pyright = {
settings = {
python = {
analysis = {
autoSearchPaths = true,
diagnosticMode = "workspace",
useLibraryCodeForTypes = true,
typeCheckingMode = "off",
},
},
},
}
}, },
-- customize how language servers are attached -- customize how language servers are attached
handlers = { handlers = {

26
lua/plugins/mason.lua

@ -1,24 +1,28 @@
---@type LazySpec
return { return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
config = function() dependencies = {
require("lspconfig").pyright.setup { {
settings = { "folke/lazydev.nvim",
python = { ft = "lua",
analysis = { opts = {
autoSearchPaths = true, library = {
diagnosticMode = "workspace", { path = "${3rd}/luv/library", words = { "vim%.uv" } },
useLibraryCodeForTypes = true,
typeCheckingMode = "off",
}, },
}, },
}, },
} },
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require "lspconfig"
lspconfig.lua_ls.setup { capabilities = capabilities }
end, end,
}, },
{ {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
dependencies = {
{ "williamboman/mason.nvim" },
},
opts = { opts = {
ensure_installed = { ensure_installed = {
"lua_ls", "lua_ls",

Loading…
Cancel
Save