Cannot format files in VS Code remote environments (WSL, Docker)
See original GitHub issueSummary
Prettier for VS Code is not formatting the php code.
Github Repository to Reproduce Issue
Any setup with Prettier and PHP plugin and any PHP file.
Steps To Reproduce:
- Install prettier and PHP plugin
- Create PHP file wrongly formatted such as indentation.
- Try format.
Expected result
File should be formatted as if were using CLI.
Actual result
VS Code shows message Extension 'Prettier - Code formatter' cannot format '_ide_helper.php'
Additional information
It works just perfect if using CLI. Image above displays CLI charming yet VS Code failing.
That clearly suggests that the PHP plugin and the Prettier itself are fine.
Also to note, I have used for good while setup where plugin-php would be installed inside the extension’s folder. That also doesn’t work anymore. 😦
VS Code Version: 1.40.2 [latest]
Version: 1.40.2 (user setup)
Commit: f359dd69833dd8800b54d458f6d37ab7c78df520
Date: 2019-11-25T14:54:45.096Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362
Prettier Extension Version: 3.11.0 [latest]
OS and version: Windows 10 1903 but working with WSL 1 Ubuntu 18
Prettier Log Output
["INFO" - 2:36:48 PM] Extension Name: "prettier-vscode".
["INFO" - 2:36:48 PM] Extension Version: "3.11.0".
["INFO" - 2:36:48 PM] Loaded module 'prettier@1.19.1' from '/home/lukas/dev/malgodt/node_modules/prettier/index.js'
["INFO" - 2:36:48 PM] Enabling prettier in workspace 'malgodt' for languages:
[
"javascript",
"mongo",
"javascriptreact",
"typescript",
"typescriptreact",
"json",
"jsonc",
"json5",
"css",
"postcss",
"less",
"scss",
"graphql",
"markdown",
"mdx",
"html",
"vue",
"yaml",
"php"
]
["INFO" - 2:36:48 PM] Enabling prettier for range supported languages
[
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"json",
"graphql"
]
["INFO" - 2:36:50 PM] Loaded module 'prettier@1.19.1' from '/home/lukas/dev/malgodt/node_modules/prettier/index.js'
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Using Dev Containers in WSL 2 - Visual Studio Code
We need to select the folder we want to open in a container. First, make sure you've installed the Dev Containers extension. We...
Read more >Remote Development Tips and Tricks - Visual Studio Code
This article covers troubleshooting tips and tricks for each of the Visual Studio Code Remote Development extensions. See the SSH, Containers, and WSL...
Read more >Docker Tools Tips and Tricks - Visual Studio Code
Make sure Docker engine is installed on the remote machine and that Docker CLI works (run docker ps from the terminal and ensure...
Read more >Attach to a running container - Visual Studio Code
To attach to a Docker container, either select Dev Containers: Attach to Running Container... from the Command Palette (F1) or use the Remote...
Read more >Remote Development with VS Code
Use Windows to develop in a Linux-based environment, using platform-specific toolchains and utilities. Edit files located in WSL or the mounted ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be fixed in 3.13+. Please reopen if you continue to see the issue.
https://github.com/prettier/prettier-vscode/issues/1111#issuecomment-561278069
Install extension v3.9.0 can solve this problem temporarily