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
Support for editorUrl
on Docker runtime
#7043
Comments
Can you post examples of a few paths of how they look inside your Docker container and in your actual host filesystem? How does the TableErrorFormatter looks like vs. how would you like it to look like? |
No problem 🙂
In Docker Composer file we mount local path to container's Docker usageLet's illustrate how our structure looks like:
PHPStan is executed from
Analysis and
|
Something like this could work: parameters:
editorUrlMapping:
- .:/app The |
@ondrejmirtes it won't work because when PHPStan is executed inside container it does not have any context from localhost. For PHPStan in container,
In the end it always requires user to configure explicit base path to prepare |
I came here looking for the same option. Specifying an absolute path would also be fine in my case - especially since we have extensible config files. Example from another appFor inspiration, the Ray app has a similar setting which works well for my setting: https://spatie.be/docs/ray/v1/environment-specific-configuration/docker My SuggestionI'd suggest we can add a couple of config values under https://phpstan.org/config-reference#config-file parameters:
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
remotePath: '/app/'
localPath: '\\wsl$\Ubuntu\home\user\my-app\' And then in phpstan it is (I believe) simply a find & replace at the last minute. |
bit offtopic: note that this wont work if you click the link in WSL2. Custom protocols are not yet supported: |
This allows running PHPStan within Docker environment and output errors with links to files on the host (`editorUrl` must be configured using actual host's path to the project + `%rel_file%`). Fixes phpstan/phpstan#7043
This allows running PHPStan within Docker environment and output errors with links to files on the host (`editorUrl` must be configured using actual host's path to the project + `%rel_file%`). Fixes phpstan/phpstan#7043
This allows running PHPStan within Docker environment and output errors with links to files on the host (`editorUrl` must be configured using actual host's path to the project + `%rel_file%`). Fixes phpstan/phpstan#7043
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature request
I would like to ask for support for Docker runtime in terms of
editorUrl
. I really like this feature but it requires running PHPStan with locally installed PHP while we work on Docker runtime. Paths are not the same, soeditorUrl
does not work properly because it prints links with container’s paths, not local paths. Clicking such link ends with empty PHPStorm window.Maybe some kind of
%rel_file%
, sophpstorm://open?file=/local/path/%%rel_file%%&line=%%line%%
could be used 🤔 ?ℹ️ IMPORTANT: relative path should be calculated based on project's root (where PHPStan's config resides)
The text was updated successfully, but these errors were encountered: