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

editorUrl not working in terminals that do not support links. since phpstan >= 1.4.7 #7796

Closed
Chris53897 opened this issue Aug 15, 2022 · 13 comments
Labels

Comments

@Chris53897
Copy link

Bug report

Hi. Does somebody has the same problem or can confirm that it works?
PHP 8.1

Code snippet that reproduces the problem

env COLUMNS=200 phpstan analyse src tests -c phpstan.neon --level=6 --no-progress --memory-limit=2048M

#5013 (comment)

I copied the Line from the Website
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'

Actual output (in phpStorm)


Line src/Controller/Foo.php


24 Negated boolean expression is always false.
✏️ src/Controller/Foo.php


Expected output


Line src/Controller/Foo.php


24 Negated boolean expression is always false.
✏️ phpstorm://open?file=src/Controller/Foo.php&line=24


Did PHPStan help you today? Did it make you happy in any way?

Not Today. But totally in general. Thank you

@mergeable
Copy link

mergeable bot commented Aug 15, 2022

This bug report is missing a link to reproduction at phpstan.org/try.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

The line ✏️ src/Controller/Foo.php should be clickable anyway. What OS and terminal do you use?

@Chris53897
Copy link
Author

Chris53897 commented Aug 15, 2022

The build in functions from PhpStorm 2022.2. should be zsh
I tried in zsh directly (same output)
Mac OS M1

@ThomasLandauer
Copy link
Contributor

It's not working for me too.

@Chris53897
Copy link
Author

@ThomasLandauer zsh on mac m1 too or which OS and terminal do you use?

@ThomasLandauer
Copy link
Contributor

KDE's "Konsole" on kubuntu.
I think it's been broken for several months now.

@ondrejmirtes
Copy link
Member

Please try to pin down in which PHPStan release it last worked.

@ThomasLandauer
Copy link
Contributor

It' broken since 1.4.7.

1.4.6:

 ------ -------------------------------------------------------------------------------------------------------- 
  Line   src/Twig/AppExtension.php                                                                               
 ------ -------------------------------------------------------------------------------------------------------- 
  181    No error to ignore is reported on line 181.                                                             
         ✏️  phpstorm://open?file=/home/...
 ------ --------------------------------------------------------------------------------------------------------

1.4.7:

 ------ --------------------------------------------- 
  Line   src/Twig/AppExtension.php                    
 ------ --------------------------------------------- 
  181    No error to ignore is reported on line 181.  
         ✏️  src/Twig/AppExtension.php                
 ------ ---------------------------------------------

phpstan.neon:

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

@Chris53897
Copy link
Author

I can confirm this. And i noticed that it works with 1.4.6 in zsh with cmd+ double-click but not in PhpStorm itself.
But if changed to editorUrl: 'http://google.de/' it gets clickable with a single click in PhpStorm itself.
I would suggest to start with Problem 1) Not showing the editorUrl. 2) Protocol-Handling (that is more complicated and differs for OS)

@Chris53897
Copy link
Author

If i run make tests local on 1.x branch, that is the only test that fails.
I made a PR.

Time: 03:11.321, Memory: 482.31 MB

There was 1 failure:

1) PHPStan\Command\ErrorFormatter\TableErrorFormatterTest::testEditorUrlWithRelativePath
Failed asserting that ' ------ ----------------\n
  [32mLine[39m   [32mFoo.php[39m\n
 ------ ----------------\n
  12     Test\n
         ✏️  rel/Foo.php\n
 ------ ----------------\n
\n
\n
[37;41m                                                                                [39;49m\n
[37;41m [ERROR] Found 1 error                                                          [39;49m\n
[37;41m                                                                                [39;49m\n
\n
' contains "editor://custom/path/rel/Foo.php".

/Users/chris/PhpstormProjects/open-source/phpstan-src/tests/PHPStan/Command/ErrorFormatter/TableErrorFormatterTest.php:193

@Chris53897 Chris53897 changed the title editorUrl not working for me editorUrl not working in terminals that do not support links. since phpstan >= 1.4.7 Aug 30, 2022
@ondrejmirtes
Copy link
Member

With phpstan/phpstan-src#2035 and PHPStan 1.9.3 you'll be able to use editorUrlTitle to fix this.

Please, if you manage to fix it, tell us how exactly you did that, so we can mention it in the documentation #8446

Thanks!

@ThomasLandauer
Copy link
Contributor

The PR did not fix this, but see #8519 for a general solution to all editorUrl-related issues.

@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
Projects
None yet
Development

No branches or pull requests

3 participants