Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Automatically invoke lspconfig setup for every installed LSP server
- mason_lspconfig.setup_handlers {
- function(server_name)
- lspconfig[server_name].setup {
- capabilities = capabilities,
- on_attach = on_attach,
- root_dir = lspconfig.util.root_pattern("package.json", "tsconfig.json",
- "jsconfig.json", ".git", ".gitignore")
- }
- end,
- lua_ls = function()
- lspconfig.lua_ls.setup({
- on_attach = on_attach,
- capabilities = capabilities,
- Lua = {
- runtime = {
- version = 'LuaJIT',
- },
- diagnostics = {
- globals = { "vim" },
- disable = { 'unused-local' }, -- Disable the "unused variable" error
- },
- workspace = {
- checkThirdParty = false,
- library = {
- [vim.fn.expand "$VIMRUNTIME/lua"] = true,
- [vim.fn.stdpath "config" .. "/lua"] = true,
- },
- },
- telemetry = { enable = false },
- },
- })
- end,
- pylsp = function()
- lspconfig.pylsp.setup {
- on_attach = on_attach,
- capabilities = capabilities,
- settings = {
- plugins = { rope_autoimport = { true } }
- }
- }
- end,
- tsserver = function()
- lspconfig.tsserver.setup {
- on_attach = on_attach,
- capabilities = capabilities,
- cmd = { 'typescript-language-server', '--stdio' },
- settings = {
- diagnostics = { ignoredCodes = { 6133 } }
- }
- }
- end,
- }
Advertisement
Add Comment
Please, Sign In to add comment