Skip to content

Conversation

vrana
Copy link
Contributor

@vrana vrana commented Jun 28, 2025

PhpStorm's internal terminal is very peculiar about paths it link. Pretty much only "at path:line" is linked: https://youtrack.jetbrains.com/issue/IJPL-103639/#focus=Comments-27-3994543.0-0.

I know that I can write my custom error formatter but I see a value in this working by default. Also replicating all features of TableErrorFormatter is not trivial in custom formatter.

Before:
image

After:
image

vrana added 2 commits June 28, 2025 08:59
PhpStorm's internal terminal is very peculiar about paths it link. Pretty much only "at path:line" is linked: https://youtrack.jetbrains.com/issue/IJPL-103639/#focus=Comments-27-3994543.0-0.

I know that I can write my custom error formatter but I see a value in this working by default. Also replicating all features of TableErrorFormatter is not trivial in custom formatter.
@ondrejmirtes
Copy link
Member

Thank you for the PR. I have an idea: Can we detect we're running in PhpStorm's internal terminal via some environment variable or other means, and output a clickable compatible clickable path regardless of user's editorUrl setting? Thank you!

@vrana
Copy link
Contributor Author

vrana commented Jul 24, 2025

PhpStorm sets TERMINAL_EMULATOR=JetBrains-JediTerm which we could use. However, I SSH to a LXC container from PhpStorm and run PhpStan there. Thus this variable is not available.

@ondrejmirtes
Copy link
Member

Have you tried setting various editorUrl / editorUrlTitle values to make this work on your machine without changing PHPStan?

See the docs: https://phpstan.org/user-guide/output-format#opening-file-in-an-editor

I'm pretty sure you could add the word at as part of those values.

@vrana
Copy link
Contributor Author

vrana commented Sep 3, 2025

As visible at the screenshot, PhpStan doesn't create link if the line doesn't start with at.

@ondrejmirtes
Copy link
Member

I feel like the root issue in on JetBrains' shoulders and not on PHPStan's. I don't want to compromise the output of table error formatter for everyone because someone didn't fix a bug for 5 years on their side

@vrana
Copy link
Contributor Author

vrana commented Sep 7, 2025

Makes sense.

@vrana vrana closed this Sep 7, 2025
@vrana vrana deleted the patch-1 branch September 12, 2025 19:26
@vrana
Copy link
Contributor Author

vrana commented Sep 25, 2025

Would you accept a configuration parameter?

@ondrejmirtes
Copy link
Member

Configuration parameter for what exactly? Something that would remove all emojis from output?

@vrana
Copy link
Contributor Author

vrana commented Sep 25, 2025

I need an at instead of the emoji. But I guess I can also live with | sed 's~✏️~at~'.

@ondrejmirtes
Copy link
Member

Could you set TERMINAL_EMULATOR=JetBrains-JediTerm in your custom terminal, and we could use that environment variable to detect that we're inside PhpStorm for both you and users that use it directly?

@vrana
Copy link
Contributor Author

vrana commented Sep 25, 2025

OK.

@ondrejmirtes
Copy link
Member

A new one, the implementation will be different. Thanks! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants