-
Hey there, sorry to bother and thanks for the hard work. I'm setting up development for vue with 3 extensions: coc-prettier, coc-eslint and coc-tailwindcss. I read somewhere that there's no support for having more than one formatter at the same time, and instead use only one (in my case coc-prettier), and the rest of the formatters can be applied with BufWritePre autocommands. I did just that but something weird is going on. The formatter that is used is kind of non-deterministic. Sometimes it will format with prettier, sometimes it will format with coc-tailwindcss and coc-eslint. video of the behaviour: Screen.Recording.2022-03-15.at.22.40.13.movthe config to run format actions on save: vim.cmd([[
autocmd BufWritePre *js,*.vue,*.ts :silent call CocAction('runCommand', 'eslint.executeAutofix')
autocmd BufWritePre *vue,*.html,*.erb :silent call CocAction('runCommand', 'tailwindCSS.headwind.sortTailwindClasses')
]]) on coc-settings i use the defaults, which is any idea what could i do to be able to run prettier and these 2 formatters on save? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
on #2704 you said that the formatting that gets applied is the one from the first server to respond, which makes a lot of sense. I haven't found a way to set BufWritePre autcmds to run the other 2 formatters after prettier, sadly :( |
Beta Was this translation helpful? Give feedback.
-
i solved it by using |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
:CocCommand
is async, you may need:call CocAction('runCommand', ...)
instead.