harikt / php-hyperclick

PHP hyperclick package for atom text editor, open your php files on the go
MIT License
19 stars 6 forks source link

Error #12

Open ameenross opened 7 years ago

ameenross commented 7 years ago

When I try to click through to a definition, all I get is a red popup saying "error". I checked the console and that was empty as well

Platform: Linux x64 Atom version: 1.13.0

harikt commented 7 years ago

I will try to improve the debug functionality.

Sorry for the hassle.

If you have some code it may help to understand how to handle these situations.

ameenross commented 7 years ago

I called the PHP file manually via CLI. It seems there's a fatal error which isn't handled.

The error in my case seems to be due to Laravel's class alias feature (which I dislike). The aliased class cannot be found.

harikt commented 7 years ago

:-) . I will see what we can do in that case.

Thank you.

ameenross commented 7 years ago

At least I found out you have to bootstrap Laravel to get their proprietary class aliasing to work:

require "bootstrap/autoload.php"; // Not vendor/ !
require "bootstrap/start.php";
harikt commented 7 years ago

@ameenross good info. I wished there is only one autoloader file . /vendor/autoload.php . Probably in this case you may want to add it to your composer.json to require these files.

ameenross commented 7 years ago

The problem is, the bootstrap autoload file requires (not require_once) the composer autoloader. It would be quite some hackwork to fix it... OTOH I wouldn't want to implement/support Laravel's stupid class aliasing. Maybe I'll just replace all usages of aliased classes.