Skip to content
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

Add VSCode setup instructions #867

Merged
merged 3 commits into from
Jun 23, 2021

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Apr 17, 2021

I had a lot trouble getting prettier working with VS Code. Initially I was trying to use the Ruby gem, but it seems the npm library is a better choice.

The approach I describe is based on @coisnepe's comment in #113.

@andyw8 andyw8 force-pushed the andyw8/add-vscode-setup-instructions branch from ec69d13 to c139f1e Compare April 17, 2021 14:14
@andyw8 andyw8 mentioned this pull request Apr 17, 2021
@andyw8 andyw8 force-pushed the andyw8/add-vscode-setup-instructions branch from c139f1e to 89f7767 Compare April 17, 2021 14:23
README.md Outdated
{
"[ruby]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true // optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// optional isn't valid json and messes up syntax highlighting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's valid in VS Code's settings config but I'll remove it.

README.md Outdated Show resolved Hide resolved
andyw8 and others added 2 commits April 19, 2021 09:51
Co-authored-by: Paul-Etienne Coisne <[email protected]>
@Petercopter
Copy link

Petercopter commented Jun 10, 2021

Thanks for this, I thrashed around a lot with the npm package vs the gem as well. I was wondering whether there should also be instructions for how this interacts with the Ruby VSCode extension https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

I would imagine a lot of people have that installed as well. I THINK I finally got everybody playing nice together by adding

"ruby.lint":{}

To the VSCode config or maybe just remove it altogether. Before I had

  "ruby.lint": {
    "rubocop": {
      "forceExclusion": true,
      "useBundler": true // enable rubocop via bundler
    }
  },

Edit: Maybe "ruby.format": false as well...

@Jonic
Copy link

Jonic commented Jun 17, 2021

Just chiming in to say that I followed the steps in this PR and I'm VERY happy with the results! Thanks very much!

@joshunger
Copy link

joshunger commented Jun 18, 2021

I'd love to see this in the README however I don't think[ruby] is necessary if you have "editor.defaultFormatter": "esbenp.prettier-vscode". I don't think you need the third bullet.

@kddnewton kddnewton merged commit 78a7897 into prettier:main Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants