Current solution does not work well with docker containers, and is overall a bit unstable and hacky currently.
To solve this, a JS language server should be used, and IPC via Std-in/out for getting the required composer information.
If IPC is problematic, due to being unable to get composer dependency changes in the PHP script, running the php script, whenever a change to workspace (PHP files) are detected, could be used instead.
This solution is how extensions, like phpcs works, and solves alot of issues with ports being unreachable when PHP and JS code is being executed from different environments.
Current solution does not work well with docker containers, and is overall a bit unstable and hacky currently.
To solve this, a JS language server should be used, and IPC via Std-in/out for getting the required composer information.
If IPC is problematic, due to being unable to get composer dependency changes in the PHP script, running the php script, whenever a change to workspace (PHP files) are detected, could be used instead.
This solution is how extensions, like phpcs works, and solves alot of issues with ports being unreachable when PHP and JS code is being executed from different environments.
It will also make the code easier to maintain.