Added autocmd for svelte lsp to fix problem with ts file changes

This commit is contained in:
josean-dev 2023-09-17 02:32:52 -04:00
parent b58f100b2b
commit 98892b75ad

View file

@ -78,8 +78,8 @@ return {
-- configure typescript server with plugin
lspconfig["tsserver"].setup({
capabilities = capabilities,
on_attach = on_attach,
capabilities = capabilities,
on_attach = on_attach,
})
-- configure css server
@ -97,7 +97,18 @@ return {
-- configure svelte server
lspconfig["svelte"].setup({
capabilities = capabilities,
on_attach = on_attach,
on_attach = function(client, bufnr)
on_attach(client, bufnr)
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { "*.js", "*.ts" },
callback = function(ctx)
if client.name == "svelte" then
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file })
end
end,
})
end,
})
-- configure prisma orm server