Skip to content

Commit

Permalink
Docs: Describe workaround for prettier-vscode
Browse files Browse the repository at this point in the history
I found this workaround in
prettier/plugin-ruby#113 and confirmed that it
works. "Run on save" stopped working for me a while ago, so I'd
recommend using prettier-vscode with the workaround instead.
  • Loading branch information
czosel committed Mar 2, 2019
1 parent 9d63463 commit 7182c7c
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,16 @@ The official [prettier plugin for atom](https://github.com/prettier/prettier-ato

### VScode

Regarding plugin support in the official plugin prettier-vscode see [this issue](https://github.com/prettier/prettier-vscode/issues/395).
The official plugin `prettier-vscode` doesn't support plugins out of the box yet, see [this issue](https://github.com/prettier/prettier-vscode/issues/395). You can use the following workaround to enable PHP support anyway:

Alternatively, install [Run on Save](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave) and add the following section to your settings:

```json
{
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.php$",
"cmd": "prettier ${file} --write"
}
]
}
}
```bash
cd ~/.vscode/extensions/esbenp.prettier-vscode-1.8.1/
npm install @prettier/plugin-php
```

After restarting VScode the plugin should work as expected.


### Vim

Regarding plugin support in the official plugin vim-prettier see [this issue](https://github.com/prettier/vim-prettier/issues/119).
Expand Down

0 comments on commit 7182c7c

Please sign in to comment.