plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Feature Request]: Filename for code generation

Open piperone opened this issue 1 year ago • 3 comments

Feature Description

This is more of a question than a feature request, really. I have created a custom code generation that uses a custom file template. It's a variation of the db migration code generation. But it appears that I can't control the filename, which by convention is timestamp + filename snakecased. Is there some way I can achieve this for my custom generation?

piperone avatar Apr 26 '24 12:04 piperone

Yes. Please check https://github.com/TheDragonCode/laravel-actions/blob/main/ide.json

adelf avatar Apr 26 '24 13:04 adelf

I don't have an ide.json-file in my project. I am able to find my custom generations inside the .idea-folder in a file called laravel-idea.xml. I tried adapting the thing from your snippet and put it in the xml-file:

<CustomGeneration>
    <option name="directory" value="database/migrations" />
    <option name="name" value="${CURRENT_TIME|format:yyyy_MM_dd_HHmmss}_${INPUT_CLASS|className|snakeCase}.php" />
    <option name="parameters">

... but that did not work.

piperone avatar Apr 26 '24 14:04 piperone

Sorry, I thought you were talking about ide.json generations... It's not possible for custom generations. I'll try to solve this somehow.

adelf avatar Apr 26 '24 14:04 adelf