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

Cannot format files in VS Code remote environments (WSL, Docker) #1114

Closed
flexchar opened this issue Dec 2, 2019 · 5 comments
Closed

Cannot format files in VS Code remote environments (WSL, Docker) #1114

flexchar opened this issue Dec 2, 2019 · 5 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@flexchar
Copy link

flexchar commented Dec 2, 2019

Summary

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.
image

Steps To Reproduce:

  1. Install prettier and PHP plugin
  2. Create PHP file wrongly formatted such as indentation.
  3. 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

image

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

image

["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'
@flexchar
Copy link
Author

flexchar commented Dec 4, 2019

Update: the extention works fine when using locally. It seems the issue arises when using any kind of VS-Code remote such as WSL or Docker container. The log output doesn't show anything useful. I have no idea how to debug. Only the failure message Extension 'Prettier - Code formatter' cannot format... appears at the bottom :)

@flexchar flexchar changed the title Cannot format PHP files Cannot format files in VS Code remote environments (WSL, Docker) Dec 4, 2019
@ding-js
Copy link

ding-js commented Dec 6, 2019

#1111 (comment)

Install extension v3.9.0 can solve this problem temporarily

@sanket-bhalerao
Copy link

reverting to v3.9.0 worked for my remote workspace (extn has issue with formatting html files)

@ntotten
Copy link
Member

ntotten commented Dec 14, 2019

This should be fixed in 3.13+. Please reopen if you continue to see the issue.

@ntotten ntotten closed this as completed Dec 14, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 12, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

4 participants