1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- local status, mason = pcall(require, "mason")
- if not status then
- return
- end
- local mason_lspconfig_status, mason_lspconfig = pcall(require, "mason-lspconfig")
- if not mason_lspconfig_status then
- return
- end
- -- import mason-null-ls plugin safely
- local mason_null_ls_status, mason_null_ls = pcall(require, "mason-null-ls")
- if not mason_null_ls_status then
- return
- end
- mason.setup({
- ui = {
- icons = {
- package_installed = "✓",
- package_pending = "➜",
- package_uninstalled = "✗",
- },
- },
- })
- mason_lspconfig.setup({
- ensure_installed = {
- "tsserver",
- "volar",
- "html",
- "cssls",
- "tailwindcss",
- "lua_ls",
- "bashls",
- "jsonls",
- },
- automatic_installation = true,
- })
- mason_null_ls.setup({
- -- list of formatters & linters for mason to install
- ensure_installed = {
- "prettier", -- ts/js formatter
- "stylua", -- lua formatter
- "eslint_d", -- ts/js linter
- },
- -- auto configured formatters & linters (with null-ls)
- automatic_installation = true,
- })
|