shawncplus / phpcomplete.vim

Improved PHP omnicompletion
http://www.vim.org/scripts/script.php?script_id=3171
595 stars 110 forks source link

autocomplete for Magento #96

Open alexdrupal opened 7 years ago

alexdrupal commented 7 years ago

Hello

In Magento 1 there is a static method to create classes. For example

Mage::getModel('core/layout') is actually new Mage_Core_Model_Layout()

Your plugin does not autocomplete magento classes yet, but do you think it is possible to make autocompletion to work with Magento's getModel calls?

Thank you

complex857 commented 7 years ago

Hmm... it sounds like this can't be arranged with the usual docblock comments (you only get one slot for any number of classes). Unfortunately the code doesn't support any plug-in / custom patterns to be added which would allow this to work without adding some hard-coded exception to support this case.

So in short: Yes, it's possible, the most simple thing that could possibly work not even that hard, but I wouldn't like to add it to the codebase like that.

The best option would probably to add some extension point to allow you to add / configure these kind of stuff without blowing up the unfortunately already quite bloated code more.

alexdrupal commented 6 years ago

Thanks!