[Bug]: Go to declaration not working on policy when using "simple directory module system"
Bug description
When using the "simple directory module system", policies "go to" and "view usage" functionality are not working if the policies and models are placed inside the module, despite Laravel auto discovery of the policies working perfectly.
Everything in Laravel Idea seems to be hardcoded to search in Models and Policies
of the root directory.
On the same note, the "search related classes" don't work either if the policies are not in the root directory of the project:
Plugin version
10.0.3.243
Operating system
Linux
Steps to reproduce
Repository demonstrating the problem: https://github.com/Tristan-MyAnaPro/laravel-idea-issue-policy-module
Configure Laravel Idea to use the "simple directory module system"
Place a model and a related policy inside the module.
Try to use "go to definition" on a can(...) or "view usage" on the policy check.
Relevant log output
N/A
Hi @adelf,
Sorry to ping you like that but I feel like 4 month without a response gives me the permission to 🤭
Just so you know, this problem still exists in Laravel Idea version 10.2.2.251.
We are not using the "Simple directory modules" anymore but the "Directory modules as composer.json packages".
Registering the policy manually inside the service provider (Gate::policy(MyModel::class, MyModelPolicy::class); fix the problem but it defeat the purpose of policy auto discovery and nice DX offered by Laravel 😿
Hope you can find a solution! Thanks for you work 💪
I added this to internal task tracker, thanks!