86 lines
2.4 KiB
Lua
86 lines
2.4 KiB
Lua
local lspconfig = require('lspconfig')
|
|
local lsp_defaults = lspconfig.util.default_config
|
|
|
|
lsp_defaults.capabilities = vim.tbl_deep_extend(
|
|
'force',
|
|
lsp_defaults.capabilities,
|
|
require('cmp_nvim_lsp').default_capabilities()
|
|
)
|
|
|
|
require'lspconfig'.tsserver.setup({
|
|
settings = {
|
|
typescript = {
|
|
inlayHints = {
|
|
includeInlayParameterNameHints = 'all',
|
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
|
includeInlayFunctionParameterTypeHints = true,
|
|
includeInlayVariableTypeHints = true,
|
|
includeInlayPropertyDeclarationTypeHints = true,
|
|
includeInlayFunctionLikeReturnTypeHints = true,
|
|
includeInlayEnumMemberValueHints = true,
|
|
}
|
|
},
|
|
javascript = {
|
|
inlayHints = {
|
|
includeInlayParameterNameHints = 'all',
|
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
|
includeInlayFunctionParameterTypeHints = true,
|
|
includeInlayVariableTypeHints = true,
|
|
includeInlayPropertyDeclarationTypeHints = true,
|
|
includeInlayFunctionLikeReturnTypeHints = true,
|
|
includeInlayEnumMemberValueHints = true,
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
require'lspconfig'.rust_analyzer.setup {
|
|
settings = {
|
|
['rust-analyzer'] = {
|
|
inlayHints = {
|
|
includeInlayParameterNameHints = 'all',
|
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
|
includeInlayFunctionParameterTypeHints = true,
|
|
includeInlayVariableTypeHints = true,
|
|
includeInlayPropertyDeclarationTypeHints = true,
|
|
includeInlayFunctionLikeReturnTypeHints = true,
|
|
includeInlayEnumMemberValueHints = true,
|
|
},
|
|
checkOnSave = {
|
|
command = 'clippy'
|
|
}
|
|
},
|
|
},
|
|
}
|
|
|
|
require('lspconfig').tailwindcss.setup({
|
|
settings = {
|
|
tailwindCSS = {
|
|
experimental = {
|
|
classRegex = {
|
|
{ "tv\\((([^()]*|\\([^()]*\\))*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]" }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|
|
|
|
require 'lspconfig'.eslint.setup({
|
|
settings = {
|
|
packageManager = 'npm'
|
|
},
|
|
on_attach = function(client, bufnr)
|
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
buffer = bufnr,
|
|
command = "EslintFixAll",
|
|
})
|
|
end,
|
|
})
|
|
|
|
--lspconfig.graphql.setup({
|
|
-- root_dir = lspconfig.util.root_pattern(".graphqlconfig", ".graphqlrc", "package.json"),
|
|
-- flags = {
|
|
-- debounce_text_changes = 150,
|
|
-- },
|
|
--})
|