From 957753ef1815bae1c8460ee042e2fdcd64ef9dd7 Mon Sep 17 00:00:00 2001 From: Binciu Viorel Date: Sun, 26 May 2024 10:10:54 +0300 Subject: [PATCH] feat: Added lsp --- lua/plugins/lsp.lua | 91 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 lua/plugins/lsp.lua diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..27e28ef --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,91 @@ +-- Extra language server protocol options + +return { + { -- Bulb in gutter for code actions + "kosayoda/nvim-lightbulb", + config = function() + require("nvim-lightbulb").setup({ + autocmd = { enabled = true }, + number = { enabled = true }, + }) + end, + }, + { -- LSP Diagnostics in top right + "dgagn/diagflow.nvim", + opts = { scope = "line" }, + }, + { -- Merge lines + "Wansmer/treesj", + keys = { + "m", + }, + dependencies = { "nvim-treesitter/nvim-treesitter" }, + config = function() + require("treesj").setup({}) + end, + }, + { -- Treesitter config + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + { -- Mason config + "williamboman/mason.nvim", + opts = { + ui = { border = "rounded" }, + ensure_installed = { + "bash-language-server", + "prettierd", + "css-lsp", + "pyright", + "autopep8", + "shellcheck", + }, + }, + }, + { + url = "https://gitlab.com/schrieveslaach/sonarlint.nvim", + ft = { "python", "typescript", "typescriptreact", "typescript.tsx" }, + dependencies = { + "mfussenegger/nvim-jdtls", + "williamboman/mason.nvim", + }, + config = function() + require("sonarlint").setup({ + server = { + cmd = { + "sonarlint-language-server", + -- Ensure that sonarlint-language-server uses stdio channel + "-stdio", + "-analyzers", + -- paths to the analyzers you need, using those for python and java in this example + vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarpython.jar"), + vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarjs.jar"), + }, + }, + filetypes = { + "python", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + }) + end, + }, +}