laravel / pennant

A simple, lightweight library for managing feature flags.
https://laravel.com/docs/pennant
MIT License
478 stars 49 forks source link

IDE support: @feature,@endfeature blade directives and code generation #24

Closed adelf closed 1 year ago

adelf commented 1 year ago

Hi.

I've implemented feature completion, blade directives, and code generation for this package in Laravel Idea.

pennant

I can hardcode this stuff, but it's much better to have it configured by ide.json file here: this can be easily updated later if needed and also can be used by other Laravel plugins for IDEs.

P.S. ifDirectives will be supported in the next Laravel Idea version.

driesvints commented 1 year ago

I'm not sure this should go into the package. We don't do this for any of our other packages? Isn't this something that's handled by a tool like https://laravel-idea.com/ ?

dinhquochan commented 1 year ago

Vote 👎 this PR, not sure 100% Laravel Developers are using PhpStorm + Laravel Idea.

adelf commented 1 year ago

@driesvints yes. Laravel Idea uses this file to make this work. It can be hard coded. However, if stubs/feature.stub file parameters({{ namespace }}, {{ class }}) will be changed or added new - it will be hard to support both versions of the package. The same is with Blade directives.

Plus, other IDEs can use this file in the future.

hailwood commented 1 year ago

@driesvints just incase it's not clear, @adelf is the creator of https://laravel-idea.com/

Adding my support here as the ide.json is seeing some uptake in packages in the community. e.g. several Spatie packages are supported in Laravel Idea as they include it in the package.