From e9fc0375198ef716c36b99fdb8afab7360defb4b Mon Sep 17 00:00:00 2001 From: Mathias Scheider Date: Thu, 26 Mar 2026 23:10:45 +0100 Subject: [PATCH] fix lsp config fot Python --- term/.config/nvim/lua/plugins/lsp-config.lua | 137 ++++++++++--------- 1 file changed, 69 insertions(+), 68 deletions(-) diff --git a/term/.config/nvim/lua/plugins/lsp-config.lua b/term/.config/nvim/lua/plugins/lsp-config.lua index 515e32b..db47035 100644 --- a/term/.config/nvim/lua/plugins/lsp-config.lua +++ b/term/.config/nvim/lua/plugins/lsp-config.lua @@ -1,70 +1,71 @@ return { - -- Mason (LSP server installer) - { - "mason-org/mason.nvim", - config = function() - require("mason").setup() - end, - }, - - -- Mason-LSPconfig (bridge Mason and nvim-lspconfig) - { - "mason-org/mason-lspconfig.nvim", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { - "pyright", -- Python - "jsonls", -- JSON - "yamlls", -- YAML - "html", -- HTML - "cssls", -- CSS - "bashls", -- Bash - "lua_ls", -- Lua - }, - automatic_enable = true, - }) - end, - }, - - -- nvim-lspconfig - { - "neovim/nvim-lspconfig", - config = function() - -- Lua - vim.lsp.config('lua_ls', { - settings = { - Lua = { - runtime = { version = "LuaJIT" }, - workspace = { library = vim.api.nvim_get_runtime_file("", true) }, - }, - }, - }) - - -- Other languages - vim.lsp.config('pyright', { - settings = { - python = { - analysis = { - typeCheckingMode = "basic", - extraPaths = {}, -- Add extra import paths if needed - }, - }, - }, -}) - vim.lsp.config('jsonls', {}) - vim.lsp.config('yamlls', {}) - vim.lsp.config('html', {}) - vim.lsp.config('cssls', {}) - vim.lsp.config('bashls', {}) - - -- Enable servers - vim.lsp.enable('lua_ls') - vim.lsp.enable('pyright') - vim.lsp.enable('jsonls') - vim.lsp.enable('yamlls') - vim.lsp.enable('html') - vim.lsp.enable('cssls') - vim.lsp.enable('bashls') - end, - }, + -- Mason (LSP server installer) + { + "mason-org/mason.nvim", + config = function() + require("mason").setup() + end, + }, + + -- Mason-LSPconfig (bridge Mason and nvim-lspconfig) + { + "mason-org/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "pyright", -- Python + "jsonls", -- JSON + "yamlls", -- YAML + "html", -- HTML + "cssls", -- CSS + "bashls", -- Bash + "lua_ls", -- Lua + "stylua", + }, + automatic_enable = true, + }) + end, + }, + + -- nvim-lspconfig + { + "neovim/nvim-lspconfig", + config = function() + -- Lua + vim.lsp.config("lua_ls", { + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + workspace = { library = vim.api.nvim_get_runtime_file("", true) }, + }, + }, + }) + + -- Other languages + vim.lsp.config("pyright", { + settings = { + python = { + analysis = { + typeCheckingMode = "basic", + extraPaths = {}, -- Add extra import paths if needed + }, + }, + }, + }) + vim.lsp.config("jsonls", {}) + vim.lsp.config("yamlls", {}) + vim.lsp.config("html", {}) + vim.lsp.config("cssls", {}) + vim.lsp.config("bashls", {}) + + -- Enable servers + vim.lsp.enable("lua_ls") + vim.lsp.enable("pyright") + vim.lsp.enable("jsonls") + vim.lsp.enable("yamlls") + vim.lsp.enable("html") + vim.lsp.enable("cssls") + vim.lsp.enable("bashls") + end, + }, }