From 7430ebed8eab0364452a6cdcaa209f8a7288e44d Mon Sep 17 00:00:00 2001 From: Squibid Date: Thu, 8 May 2025 18:18:34 -0500 Subject: kitchen sink now don't support any version lower than 0.11.0 for lsp - dap now works for java and c --- lua/conf/plugins/mason-lspconfig.lua | 136 ----------------------------------- 1 file changed, 136 deletions(-) delete mode 100644 lua/conf/plugins/mason-lspconfig.lua (limited to 'lua/conf/plugins/mason-lspconfig.lua') diff --git a/lua/conf/plugins/mason-lspconfig.lua b/lua/conf/plugins/mason-lspconfig.lua deleted file mode 100644 index c4e4684..0000000 --- a/lua/conf/plugins/mason-lspconfig.lua +++ /dev/null @@ -1,136 +0,0 @@ -local misc = require("core.misc") -local lsp = require("core.lsp.functions") -local map = misc.map - -return { "williamboman/mason-lspconfig.nvim", - requires = { - "williamboman/mason.nvim", - { "neovim/nvim-lspconfig", - disable = not vim.fn.has("nvim-0.8.0"), - function() - lsp.setup() - end - }, - - -- these two update some lsp capabilities and therefore must be run first - -- "hrsh7th/cmp-nvim-lsp", - -- "kevinhwang91/nvim-ufo" - }, - function() - local lspconfig = require("lspconfig") - local util = require("lspconfig.util") - - -- setup language servers - require("mason-lspconfig").setup { - ensure_installed = { - "lua_ls", - "clangd", - "jdtls", - "phpactor", - "html", - "cssls", - "bashls", - "zls" - -- "asm-lsp", -- seems to be broken - }, - - -- setup all handlers - handlers = { - function(server_name) - lspconfig[server_name].setup {} - end, - - -- setup luals - ["lua_ls"] = function(server_name) - local root_files = { ".luarc.json", ".luarc.jsonc", ".luacheckrc", - ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", - "README.md" - } - - -- FIXME: luals seems to start up twice and sends back twice the - -- completions (one configured with the below settings and one without) - lspconfig[server_name].setup { - settings = { - Lua = { - diagnostics = { - globals = { "vim", "mp" } - }, - runtime = { - version = "LuaJIT" - }, - format = { - enable = false - }, - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME - } - } - } - }, - - root_dir = function(fname) - local root = util.root_pattern(unpack(root_files))(fname) - if root and root ~= vim.env.HOME then - return root - end - - root = util.root_pattern("lua/")(fname) - if root then - return root - end - return util.find_git_ancestor(fname) - end - } - end, - - -- setup clangd - ["clangd"] = function(server_name) - lspconfig[server_name].setup { - on_attach = function(client, bufnr) - -- add some clangd specific mappings - local opts = { buffer = bufnr } - map("n", "o", "ClangdSwitchSourceHeader", opts) - end, - - cmd = { - "clangd", - "--background-index", - "--clang-tidy", - "--header-insertion=iwyu", - "--completion-style=detailed", - "--function-arg-placeholders", - "--fallback-style=llvm" - }, - init_options = { - usePlaceholders = true, - clangdFileStatus = true, - fallback_flags = { - "-xc" -- makes clangd think we"re using c instead of c++ - } - } - } - end, - - -- disable it, we start this using nvim-jdtls - ["jdtls"] = function(_) end, - - -- setup basedpyright - ["basedpyright"] = function(server_name) - lspconfig[server_name].setup { - on_attach = function(client, bufnr) - -- add some basedpyright specific mappings - local opts = { buffer = bufnr } - map("n", "cri", "PyrightOrganizeImports", opts) - end, - } - end - }, - - ["openscad_lsp"] = function(server_name) - lspconfig[server_name].setup {} - end - } - end -} -- cgit v1.2.1