Open coaxial opened 2 years ago
Hi same problem for me... Comments disappearing as well as shebang line
#! /usr/bin/env ruby
I have the same issue :(
My solution was to use Neovims null-ls.nvim package for ruby.
What version of the @prettier/plugin-ruby
npm package are you using?
There is a bug in versions of the @prettier/plugin-ruby
npm package lower than 1.0 that removes comments from some parts of the code.
You can try updating your version of the @prettier/plugin-ruby
to >=1.0.0 <4.0.0
and see if it solves the error.
npm install --save-dev @prettier/plugin-ruby@">=1.0.0 <4.0.0"
Do you want to request a feature or report a bug? A bug
What is the current/expected behavior? current: deletes comments. Expected: leave comments alone
What version of
vim-prettier
are you using - (output of:PrettierVersion
) ? 1.0.0-betaWhat version of
prettier
are you using - (output of:PrettierCliVersion
) ? 2.3.1What is your
prettier
executable path - (output of:PrettierCliPath
) ?~/.vim/plugged/vim-prettier/node_modules/.bin/prettier
Did this work in previous versions of vim-prettier and/or prettier ? I don't know
With
let g:prettier#autoformat=1
, create a new buffer andset ft=ruby
. Saving this buffer:Will modify it to:
My config file:
For those affected, a temporary fix in your
.vimrc
: