mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
feat(python): added option to configure basedpyright as lsp. Check the python extra docs. Fixes #2787
This commit is contained in:
parent
fa0e538838
commit
f055265bff
2 changed files with 28 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
if lazyvim_docs then
|
||||||
|
-- LSP Server to use for Python.
|
||||||
|
-- Set to "basedpyright" to use basedpyright instead of pyright.
|
||||||
|
vim.g.lazyvim_python_lsp = "pyright"
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
@ -7,11 +13,28 @@ return {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
-- basedpyright support.
|
||||||
|
-- Remove when merged: https://github.com/williamboman/mason-lspconfig.nvim/pull/379
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
if vim.g.lazyvim_python_lsp == "basedpyright" then
|
||||||
|
opts.ensure_installed = opts.ensure_installed or {}
|
||||||
|
table.insert(opts.ensure_installed, "basedpyright")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
opts = {
|
opts = {
|
||||||
servers = {
|
servers = {
|
||||||
pyright = {},
|
pyright = {
|
||||||
|
enabled = vim.g.lazyvim_python_lsp ~= "basedpyright",
|
||||||
|
},
|
||||||
|
basedpyright = {
|
||||||
|
enabled = vim.g.lazyvim_python_lsp == "basedpyright",
|
||||||
|
},
|
||||||
ruff_lsp = {
|
ruff_lsp = {
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
|
4
lua/lazyvim/types.lua
Normal file
4
lua/lazyvim/types.lua
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---@class LazyVimGlobals
|
||||||
|
vim.g = {}
|
||||||
|
|
||||||
|
_G.lazyvim_docs = true
|
Loading…
Add table
Add a link
Reference in a new issue