laravel-idea / plugin

Laravel Idea plugin for PhpStorm
https://laravel-idea.com/
173 stars 7 forks source link

Allow separate "sources path" in/outside of modules #176

Closed inxilpro closed 10 months ago

inxilpro commented 3 years ago

Right now the "Directory modules as composer.json packages" option let's you choose the name of your "sources path" but this overrides the root module as well. The default setup for InterNACHI/modular puts your module source files in src/ while keeping your app's source files in app/.

For example:

We're currently using src as "Sources path" and app-modules as "Root directory path" which works for all our modules, but it means that when we create a file in the "root module" it's created in [root]/src/... rather than [root]/app/...

I think the fix would just to add a "Module sources path" and a "Application sources path" or similar. An even more flexible option would be to read the autoload.psr-4 configuration inside each module's composer.json file, but this would come with the added complexity of handling additional PSR-4 mappings (i.e. Tests).

Thank you again for all your hard work on this!

adelf commented 3 years ago

it means that when we create a file in the "root module" it's created in [root]/src/... rather than [root]/app/...

That is strange. Currently, the app folder is hard-coded as the main folder for all root module code files. I just checked the 3.6.1 version, and it creates everything correctly: app folder for the Root module and src folders for modules.

adelf commented 3 years ago

My module settings for InterNACHI/modular project:

image

inxilpro commented 3 years ago

Hm. This is what happens for me with plugin version 3.6.1.203 on PhpStorm 2020.3:

https://user-images.githubusercontent.com/21592/103708514-b0771580-4f7e-11eb-9f19-ffb411686911.mp4

adelf commented 3 years ago

Found the reason. Thank you. Will be fixed.

inxilpro commented 3 years ago

I think it's because I overrode the code generation settings before the module option existed! I'm going to try to revert those back and see if that fixes it.

inxilpro commented 3 years ago

No… that didn't fix it.

inxilpro commented 3 years ago

Oh, I take that back. It won't revert back. Clicking "Apply" does nothing, and if I hit "OK" and return to the plugin settings, the settings revert:

https://user-images.githubusercontent.com/21592/103711388-53329280-4f85-11eb-815f-fd93d104d04a.mp4

adelf commented 10 months ago

It was implemented in one of the previous versions. I hope we can close this now.

image