msamgan / vscode-larapint

vscode extension for laravel pint
https://marketplace.visualstudio.com/items?itemName=msamgan.laravel-pint-vscode
MIT License
9 stars 2 forks source link

Doesn't work in devcontainer #25

Closed larsnystrom closed 1 year ago

larsnystrom commented 1 year ago

When I try to use this extension in a devcontainer, an error occurs:

Something went wrong while running Laravel Pint In ConfigurationResolver.php line 390: The path "/workspaces/myapp/app/Exceptions/Handler.php" is not readable.

I suspect the extension doesn't execute in the context of the devcontainer? I'm not sure how extensions works, but the file exists and is readable within the container.

Thank you!

msamgan commented 1 year ago

thanks for the issue. ill look into it.

larsnystrom commented 1 year ago

Hi again, it appears this was a problem on my end. I can now run the "Laravel Pint: Format current file" command. However, I can't get the regular "Format Document" command to work. I have added

  "[php]": {
    "editor.defaultFormatter": "msamgan.laravel-pint-vscode"
  },

to my settings.json, but when I run the "Format Document" command, it says "There is no formatter for 'php' files installed.".

EDIT: When I open my workspace using Remote-SSH and try to "Format Document" it says "Extension 'Laravel Pint Formatter' is configured as formatter but it cannot format 'PHP' files". Which is strange?

EDIT2: I have also added "editor.laravel.pint.enabled": true to my settings.json, and still experience the same issue. However, that setting is grayed out so maybe it has changed name or something?

Skärmavbild 2023-03-15 kl  09 47 20
larsnystrom commented 1 year ago

I'm going to close this, as I could get it to run in a devcontainer, but not automatically on-save (which seems like a separate issue, and maybe something specific to my setup).