Fixed ts formatting with tsserver
This commit is contained in:
@@ -18,10 +18,21 @@ return {
|
||||
|
||||
local on_attach = require("taken.utils.on_attach")
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
local augroup = vim.api.nvim_create_augroup("Typescript_tools", {})
|
||||
|
||||
typescript_tools.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
on_attach = function(client, bufnr)
|
||||
on_attach(client, bufnr)
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ async = false })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
tsserver_file_preferences = {
|
||||
includeCompletionsForModuleExports = true,
|
||||
|
||||
Reference in New Issue
Block a user