75 lines
2.3 KiB
Lua
75 lines
2.3 KiB
Lua
return {
|
|
"mason-org/mason-lspconfig.nvim",
|
|
opts = {},
|
|
dependencies = {
|
|
{ "mason-org/mason.nvim", opts = {} },
|
|
"neovim/nvim-lspconfig",
|
|
},
|
|
config = function()
|
|
require("mason-lspconfig").setup {
|
|
ensure_installed = {
|
|
"lua_ls",
|
|
"prettier",
|
|
"html",
|
|
"tailwindcss",
|
|
"eslint",
|
|
"ts_ls",
|
|
"emmet_ls",
|
|
"cssls"
|
|
},
|
|
}
|
|
|
|
vim.lsp.config("lua_ls", {
|
|
on_init = function(client)
|
|
if client.workspace_folders then
|
|
local path = client.workspace_folders[1].name
|
|
if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then
|
|
return
|
|
end
|
|
end
|
|
|
|
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
|
runtime = {
|
|
version = 'LuaJIT'
|
|
},
|
|
workspace = {
|
|
checkThirdParty = false,
|
|
library = {
|
|
vim.env.VIMRUNTIME
|
|
}
|
|
}
|
|
})
|
|
end,
|
|
settings = {
|
|
Lua = {}
|
|
}
|
|
})
|
|
|
|
vim.lsp.config("ts_ls", {
|
|
settings = {
|
|
typescript = {
|
|
inlayHints = {
|
|
includeInlayParameterNameHints = "none",
|
|
includeInlayVariableTypeHints = true,
|
|
includeInlayPropertyDeclarationTypeHints = true,
|
|
includeInlayFunctionLikeReturnTypeHints = true,
|
|
includeInlayFunctionParameterTypeHints = false,
|
|
includeInlayEnumMemberValueHints = true,
|
|
},
|
|
},
|
|
javascript = {
|
|
inlayHints = {
|
|
includeInlayParameterNameHints = "none",
|
|
includeInlayVariableTypeHints = true,
|
|
includeInlayPropertyDeclarationTypeHints = true,
|
|
includeInlayFunctionLikeReturnTypeHints = true,
|
|
includeInlayFunctionParameterTypeHints = false,
|
|
includeInlayEnumMemberValueHints = true,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
vim.lsp.inlay_hint.enable(true)
|
|
end
|
|
}
|