-
-
Notifications
You must be signed in to change notification settings - Fork 100
Unable to use the plugin with VSCode + Prettier extension since 3.x.x release #1253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@DashwoodIce9 have you installed the required gems? (See the README) |
I'm assuming you're facing the same issues as described in this comment: #1232 (comment). Please see that issue for more details. |
@kddnewton I'm also seeing this issue specifically using the VS Code plugin - running prettier directly via the CLI works fine, but running via VS Code (ie run on save or using the "Format Document" command) results in the same error in the issue description. I've followed all the instructions in the README to install the required gems. Could there have been a change in 3.0 that would have affected how the VS Code plugin specifically is able to interact with prettier? |
Still experiencing this, and nothing in the linked comment from 22nd of July gives any details on why this happens specifically for the VSCode plugin. |
@hidde-jan which version of Ruby is your VSCode plugin using? |
FWIW I had this issue and had the gems in my gemfile. It didn't work until I installed them with gem install. Ruby 3.1.2. |
That probably means you're running with a different set of gem load paths and you need to have it available globally. |
@hidde-jan I have trouble debugging this because it entirely has to do with your system. The plugin expects that you have the gems on the correct load path. If you don't, it's going to cause issues. |
Yep I usually always vendor bundle my gems. So for this plugin and these gems related I just |
I've tried to create a devcontainer that mirrors the one of the project I'm using it in, but there it does seem to work, even though the setup is almost the same. Maybe there's some conflict with another extension that I didn't install in my sandbox project? Unfortunately, it seems to be caused by vscode, and the error message is not helpful in drilling down deeper into the problem:
|
Wow - I had this problem and just realised how to fix it (your mileage may differ). I was using rvm and had just upgraded to 3.1.2 and installed the required gems. However I hadn't set the default Ruby in RVM to 3.1.2 - so I had the required gems installed in 3.1.2 but not in 3.1.1 (which was my default). So VSCode was looking for the gems in rvm 3.1.1, and they weren't there. Setting my default ruby to 3.1.2 fixed it. |
For use closing VS code, |
Metadata
2.7.6
12.22.12
,14.20.0
,16.13.0
@prettier/plugin-ruby
orprettier
gem version: Every version since3.0.0
syntax_tree
version: latestInput
How I've integrated with VSCode
Prettier - Code formatter
plugin version9.5.0
.cd ~/.vscode-server/extensions/esbenp.prettier-vscode-9.5.0
npm i @prettier/plugin-ruby
settings.json
to include -Prettier extension output upon giving the format command
With v2.1.0 (last working version)
Output
The text was updated successfully, but these errors were encountered: