Haehnchen / idea-php-laravel-plugin

Laravel Framework Plugin for PhpStorm / IntelliJ IDEA
MIT License
572 stars 108 forks source link

Enable Finding Symbol with Class@Method format #237

Closed diogogomeswww closed 5 years ago

diogogomeswww commented 5 years ago

Right now we can find an symbol with the Class::Method format.

But Laravel uses Class@Method everywhere.

So whenever I want to navigate to that method I need to copy the text and change the @ to :: to work.

It would be very helpful if it would work out-of-the-box with the Class@Method format.

Example of searching for Class@Method: image

But if I search for Class::Method image

Thanks for great plugin!

Haehnchen commented 5 years ago

do you have an example snippet where you expect it?

diogogomeswww commented 5 years ago

Hi @Haehnchen I've edited the description to include the examples screenshots. Please let me know what you think about it and if I can help.

Haehnchen commented 5 years ago

got it. this search its not anything by this plugin. i am wondering why you need to copy it. the right way would to click directly in the editor string.

A click behavoir should be added in the editor, this can be approved. so where do you copied to from? ;)

diogogomeswww commented 5 years ago

Ah, got it. So the search can't be enhanced/changed by the plugin, correct?

If true we can close this issue, since the string Class@Method name won't appear in the editor. It will appear on the terminal when we run: php artisan route:list, in the browser in laravel telescope, a few screenshots below: image

image

I've previously open a support ticket on Jetbrains, but they sent me here...

adelf commented 5 years ago

I can only suggest to use PhpStorm style of navigating. Navigate > Class.. or Ctrl-N or Cmd-N . Then enter, for example "SDC" for finding "SkusDisplayController" class and then Ctrl-12(Cmd-F12) and enter "index". Pretty quickly.

diogogomeswww commented 5 years ago

yes, I know, but it could be faster if it would work with Class@Method formatting.

But thanks for your help and attention!

dorkyboi commented 4 years ago

In case its still relevant for someone...

You can use PhpStorm's Ctrl+Click navigation if building routes like Route::post('logout', [LoginController::class, 'logout'])->name('logout'); Works for both LoginController and logout method.

For that you just need to do three simple steps:

  1. use Route facade (use Illuminate\Support\Facades\Route;)
  2. use any controller class you need (or you may leave full qualified namespaces)
  3. change $namespace variable in App/Providers/RouteServiceProvider to empty string, so laravel would not append anything to already fully qualified controller namespaces

Of cource, used imports may stack up for big projects, but PhpStorm will conviniently collapse them, so you won't even notice.