Skip to content
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

Overview of editorUrl status and suggestion to make everybody happy :-) #8518

Closed
ThomasLandauer opened this issue Dec 13, 2022 · 3 comments
Closed

Comments

@ThomasLandauer
Copy link
Contributor

History

Out of the box, the output looks like this:

 ------ ------------------------------------------------------------------------------------------------------------------------ 
  Line   config/packages/framework.php                                                                                           
 ------ ------------------------------------------------------------------------------------------------------------------------ 
  22     Call to an undefined method Symfony\Config\Framework\SessionConfig|Symfony\Config\FrameworkConfig::enabled().           
 ------ ------------------------------------------------------------------------------------------------------------------------

Now, in phpstan/phpstan-src#515 I introduced editorUrl:
With this in your phpstan.neon:

editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'

...the output changes to:

 ------ ------------------------------------------------------------------------------------------------------------------------ 
  Line   config/packages/framework.php                                                                                           
 ------ ------------------------------------------------------------------------------------------------------------------------ 
  22     Call to an undefined method Symfony\Config\Framework\SessionConfig|Symfony\Config\FrameworkConfig::enabled().           
         ✏️ phpstorm://open?file=/home/.../config/packages/framework.php&line=22                                                
 ------ ------------------------------------------------------------------------------------------------------------------------

AFAIK, this line is clickable in any console (if you register the phpstorm:// protocol). And this is also the documented status at https://phpstan.org/user-guide/output-format#opening-file-in-an-editor

But in phpstan/phpstan-src#1013 @Seldaek (probably to fix a wrapping issue reported in #5013 by @ruudk) changed the output to a different hyperlink format which is not supported by all consoles.

So what I am getting since then is:

------ ------------------------------------------------------------------------------------------------------------------------ 
 Line   config/packages/framework.php                                                                                           
------ ------------------------------------------------------------------------------------------------------------------------ 
 22     Call to an undefined method Symfony\Config\Framework\SessionConfig|Symfony\Config\FrameworkConfig::enabled().           
        ✏️  config/packages/framework.php                                                                                       
------ ------------------------------------------------------------------------------------------------------------------------

This is not clickable anymore (for me); and this is the regression that @Chris53897 reported in #7796 (and this is still not fixed in 1.9.3).

Now in phpstan/phpstan-src#2035 @janedbal changed the visible part of this hyperlink to show the full file path.
At least, that's what I'm guessing from the description, cause hyperlinks aren't working for me, so I can't show you the output ;-)

Solution

Let's summarize what people are wanting:

  1. @Chris53897 and me want the old phpstorm://... format back, cause that's the only one that's working in their console.
  2. @Seldaek and @ruudk want to keep the new hyperlink format, cause the phpstorm://... links can get too long, and if the line gets wrapped, the link is not working anymore (right?).
  3. @janedbal wants the full file path to be displayed. (Ironically, the old phpstorm://... would have featured this ;-)

1 and 2 look incompatible to me, so I can't see any other way than to support both by introducing a new config option. My suggestion: Use the new editorUrlTitle for this: If it is present, use the new hyperlink format (with editorUrlTitles value as visible part); if it's not present, use the old phpstorm://... format.

@mergeable
Copy link

mergeable bot commented Dec 13, 2022

Hi there! 👋

Looks like you opened an issue without following one of the issue templates:

Bug report 🐛 (open an issue)

If something isn't working as expected 🤔.

Feature request 🚀 (open an issue)

I have a suggestion (and may want to implement it 🙂)!

Support question ❓ (open a discussion)

I need some help with my code because PHPStan doesn't like it.


The current issue will be closed. This is a precaution to save maintainer's time, I hope you'll understand.

Sincerely, the bot 🤖

@ThomasLandauer
Copy link
Contributor Author

New attempt to make the bot happy: #8519

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant