-
Notifications
You must be signed in to change notification settings - Fork 55
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
Errors with WSL2 containers #112
Comments
Workaround for above issue: keep local and wsl2 folders having same names. Another issue: After renaming my local folder from "dev" to "lirt" the above error is gone. Though now the new error is coming multiple times every seconds... "Do not show this" button was clicked to avoid error alert, but in output window, the error is continuous...
Please suggest.... |
The extension does nothing to WSL or docker, It simply runs a command and gets JSON data from your project in the stdout. You may change the default configuration to work on your project: https://github.com/amir9480/vscode-laravel-extra-intellisense#laravelextraintellisensebasepath https://github.com/amir9480/vscode-laravel-extra-intellisense#sample-config-to-use-docker |
Using sample config to use docker, I configured following.
|
@jd4u "LaravelExtraIntellisense.basePathForCode": "/var/www/html",
"LaravelExtraIntellisense.phpCommand": "docker-compose exec -w /var/www/html laravel.test php -r \"{code}\"" |
@amir9480 , I appreciate your guidance... Even after using container directory, error persists... 2024-05-26 20:52:53.904 [info] Laravel Extra Intellisense command started: Application Models
2024-05-26 20:52:53.904 [info] Laravel Extra Intellisense command started: Auth Data
2024-05-26 20:52:53.904 [error] Laravel Extra Intellisense Error:
Application Models
/bin/sh: 1: Syntax error: "(" unexpected
2024-05-26 20:52:53.905 [error] Laravel Extra Intellisense Error:
Auth Data
/bin/sh: 1: Syntax error: "(" unexpected |
The setup of configs is in "Remote" settings tab. User and Workspace are kept as is... |
I resolved this error in my particular setup, docker compose + linux. My config contains: "LaravelExtraIntellisense.phpCommand": "/local/path/to/project/bin/php -r \"{code}\"" where #!/bin/sh
docker compose exec -w /container/path/to/project -u 1000 php-fpm php $@ The fix was to change the shell script to this: #!/bin/sh
docker compose exec -w /container/path/to/project -u 1000 php-fpm php "$@" i.e.: ensure that the arguments passed to the php-in-docker wrapper remain quoted in the same way when passed on. @jd4u notice in your last two examples the error is coming from "LaravelExtraIntellisense.phpCommand": "docker compose exec -w /container/path/to/project -u 1000 php-fpm php -r \"{code}\"", I think that is exactly what was proposed by @amir9480 above. |
Intellisense stops working after giving errors every few seconds.
The container name "dev-laravel.test-1" is wrong.
"Laravel Extra Intellisense" is calculated container name based on local development. Using WSL2, the local folder was soft-linked with different name - "lirt". So the sail created container with name "lirt-laravel.test-1".
Suggestion: While using remote workspace, use the remote directory name instead of local directory name as prefix for container name calculation.
Request: Please release this change in next update soon. I see many related errors. The suggestion implementation will solve few of them.
The text was updated successfully, but these errors were encountered: