shopwareLabs / shopware6-phpstorm-plugin

62 stars 9 forks source link

[FEATURE] Allow overriding/extending async admin components #218

Open rohithmeethal opened 2 months ago

rohithmeethal commented 2 months ago

For admin components registered synchronously, it is possible to extend components methods using context menu. But for components registered async, context menu does not provide override suggestion. It would be nice to have this feature if possible.

eg: Context menu does not show extend/override on sw-customer-list Shopware.Component.register('sw-customer-list', () => import('./page/sw-customer-list'));

context-not-available

In old version of Shopware : We can get context menu to override the component

Component.register('sw-customer-list', {
    template,
    ....
    }

context-available

shyim commented 2 months ago

The problem is I have no idea, that this export is an component. Idk if there is some way to understand that is export is an component

rohithmeethal commented 2 months ago

I am sorry I also don't know if there is any way to identify the current file as component.

But for a dirty fix, if we just use some tag like

/**
* @component
* /

Will forcefully consider file as component ? So I can just edit the source file and add the tag when I want to extend/override some component.

This would still save a lot of time for extending components, than going manually to create folder structure and creating component file.

I hope some other better method exists and hopefully someone will give a solution