magento / magento2-phpstorm-plugin

PHPStorm Plugin for Magento 2
Open Software License 3.0
436 stars 102 forks source link

A lot of file templates are missing on new menu #861

Closed AboElnoor closed 2 years ago

AboElnoor commented 2 years ago

Hi,

I'm using PHPStorm on Ubuntu 20.04.

And many file templates are not showing in the new file menu, despite it existing in the settings. (Screenshots attached)

This is all files that show up in the new file menu: Screenshot from 2021-12-18 23-05-47

Some of those files are not showing in the new files menu, and many more: Screenshot-20211218223543-226x567

Regards,

Mainline branch: 4.3.0-develop

m2-assistant[bot] commented 2 years ago

Hi @AboElnoor. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


bohdan-harniuk commented 2 years ago

Hello, @AboElnoor!

Those files are generated during in the scope of listed on the first screenshot. As for an example, try to generate Magento 2 Entity. You will see, that it is generating not a single file, but more than 30 files. Those files are listed on the second screenshot that you provided in the ticket description.

I hope, that it is clearly for you now.

Thanks, Bohdan

bohdan-harniuk commented 2 years ago

@AboElnoor, can I help you with anything else?

If not, I will close this issue.

AboElnoor commented 2 years ago

@bohdan-harniuk But sometimes, I just need to use just one file. For example: sometimes I might need to create a web API XML file or maybe a routes file. You know many files could be needed separately.

Regards,

bohdan-harniuk commented 2 years ago

@AboElnoor but referenced by you features have nothing with it. They designed to generate Magento 2 related files by their purposes.

You can read about file and code templates here https://www.jetbrains.com/help/idea/using-file-and-code-templates.html

bohdan-harniuk commented 2 years ago

It seems that you want us to develop a lot of new generators.

bohdan-harniuk commented 2 years ago

@AboElnoor, if you want, I can show you how to generate those files with the built in intellij idea feature file and code templates.

AboElnoor commented 2 years ago

@bohdan-harniuk I believe I can just duplicate those files to be available in the new files menu. But I think it's a part of the plugin's responsibility. we can open a voting for this.

If not, it's okay to close this issue. Regards,

bohdan-harniuk commented 2 years ago

@AboElnoor, yes, as you know, it is easy to do what you want to achieve via IntelliJ Idea itself. So, there is no to add from the plugin side.

If you have clear vision, how we can make it better, please, share it with us.

We can implement it, if it will simplify usage and won't make it less convenient.

bohdan-harniuk commented 2 years ago

You can share your concept here.

AboElnoor commented 2 years ago

@bohdan-harniuk I'm thinking about making standalone files available too. as you've mentioned that generating Magento 2 Entity will generate about 30 files, but if I just need 1 or 2 files of it? should I delete the remaining files of 30 files?

So don't you think it will be much work to do which violates the purpose of making the generators?

So I think that some files need to be available out of groups too.

for example, I can create a new file for web API XML, routes XML, DI XML, and all standalone files .. etc.

AboElnoor commented 2 years ago

For me, I just copied those files to be able to use them singularly. (Screenshot attached)

Screenshot-20211220205858-286x531

But I think it's not a good solution because I need to duplicate more files every time I need a new file that I can't create singularly. I wish my point it clear now.

Regards,

bohdan-harniuk commented 2 years ago

@AboElnoor, it makes sense.

I will try to do so. Let’s keep this issue open until I will create the concept for this improvement.

bohdan-harniuk commented 2 years ago

@AboElnoor, I want to add, that you can create WEB API xml already. It doesn’t make sense to create an empty WEB API xml file, but you can declare new WEB API endpoint: https://github.com/magento/magento2-phpstorm-plugin/wiki/4.0.0-Release#web-api-declaration-generation

AboElnoor commented 2 years ago

@bohdan-harniuk Thanks for taking my request in your consideration. And thanks also for the release notes, it is extremely valuable and easy.

Regards,

SilinMykola commented 2 years ago

@magento I am working on this

bohdan-harniuk commented 2 years ago

Hello, @SilinMykola!

Let's use this code snippet:

<group id="MagentoContextBasedActionsGroup" class="com.intellij.ide.actions.NonEmptyActionGroup" text="Context Actions" popup="false" compact="true" searchable="true">
    <separator/>
    <!-- Context dependent actions -->
    <separator/>
    <add-to-group group-id="NewGroup" anchor="before" relative-to-action="NewXml"/>
</group>

To achieve similar output:

Screenshot 2022-02-03 at 18 04 38

Regards,

bohdan-harniuk commented 2 years ago

Hello, @AboElnoor!

We have started implementation of the requested feature. It will be available in the upcoming release: 4.3.0.

We will try to provide as many files as we can to this release. Rest of them we will provide in the future releases. This issue will be closed after the corresponding PR is merged. For each new file generation will be opened separate issue, this issue will be mentioned.

Regards,

AboElnoor commented 2 years ago

@bohdan-harniuk Thank you so much for taking my request into your consideration. Your effort is extremely appreciated.

Regards,

bohdan-harniuk commented 2 years ago

Hello, @AboElnoor!

Could you please help us to make a decision which files to add to the context actions group?

We have already created tasks for the next files:

Thank you in advance!

Regards,

DmitryFurs commented 2 years ago

Hi @bohdan-harniuk!

Sorry to interfere, but most likely it should be possible to generate almost all files that have their own xsd schema. But it will probably be too cumbersome and you can do with only the most frequently used files, for example:

Thanks!

bohdan-harniuk commented 2 years ago

Hello, @DmitryFurs!

Thank you for your suggestions! We will use it as a roadmap.

Regards,

bohdan-harniuk commented 2 years ago

Hello, @AboElnoor, @DmitryFurs!

We have finished development here! All improvements will be delivered in the upcoming release: 4.3.0.

Regards,

AboElnoor commented 2 years ago

Hi, @bohdan-harniuk

Have those changes been released, I still see that individual files do not exist even when my extension version is 4.3.1

Regards