Skip to content

Commit 246472e

Browse files
authored
vscode documentation update (#2194)
1 parent 5771a0f commit 246472e

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,28 @@ matrix(
217217

218218
The official [prettier plugin for atom](https://github.com/prettier/prettier-atom) supports plugins.
219219

220-
### VScode
220+
### Visual Studio Code
221221

222-
The official [prettier plugin for vscode](https://github.com/prettier/prettier-vscode) supports plugins since Version 1.10.0. To enable it, install the extension and make sure the plugin is installed _locally_ (in your project folder). After restarting VScode the plugin should work as expected.
222+
The official [prettier plugin for vscode](https://github.com/prettier/prettier-vscode) supports plugins since Version 1.10.0. To enable it, install the extension and make sure the plugin is installed _locally_ (in your project folder).
223+
224+
Visual Studio Code may not recognise the document selectors provided by this plugin, and so you can add php to your document selectors by adding the following line to `.vscode/settings.json`:
225+
226+
```json
227+
"prettier.documentSelectors": [
228+
"**/*.{js,jsx,ts,tsx,vue,html,css,scss,less,json,md,mdx,graphql,yaml,yml,php}"
229+
]
230+
```
231+
232+
You may also need to declare php as the parser in your prettier config file:
233+
234+
```json
235+
{
236+
"parser": "php",
237+
"plugins": ["@prettier/plugin-php"],
238+
}
239+
```
240+
241+
See (this issue)[https://github.com/prettier/plugin-php/issues/1730] for more discussion around potential VS Code solutions.
223242

224243
### PhpStorm / IntelliJ / Jetbrains IDE
225244

0 commit comments

Comments
 (0)