Setup tailwind, eslint and other LSP stuff

This commit is contained in:
Patrick Wadström 2024-04-30 23:00:53 +02:00
parent 9351fb8460
commit 7b8c05de4d
No known key found for this signature in database
GPG Key ID: 741D8F3C0E7B2E06
2 changed files with 35 additions and 5 deletions

View File

@ -30,11 +30,6 @@ require'lspconfig'.tsserver.setup({
includeInlayFunctionLikeReturnTypeHints = true, includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true, includeInlayEnumMemberValueHints = true,
} }
},
["rust-analyzer"] = {
checkOnSave = {
command = 'clippy'
}
} }
} }
}) })
@ -50,7 +45,41 @@ require'lspconfig'.rust_analyzer.setup {
includeInlayPropertyDeclarationTypeHints = true, includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true, includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = 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,
},
})

View File

@ -89,6 +89,7 @@ return require('packer').startup(function()
} }
} }
use { "nvim-neotest/nvim-nio" }
use 'mfussenegger/nvim-dap' use 'mfussenegger/nvim-dap'
use 'mfussenegger/nvim-jdtls' -- Java use 'mfussenegger/nvim-jdtls' -- Java
use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} } use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} }