Closed NateEag closed 10 years ago
Does this sound like a worthwhile addition? If I got this working, do you think you'd merge it?
A definite 'yes' to both. Honestly it has been a while since I seriously looked over this code because it reached a point where it was "good enough" for my personal use. But nothing about what you describe raises any red flags and so my first impression is that it would be a great addition.
Awesome, thanks. I don't have a lot of free time right now, but I'll see what I can come up with. I should at least have a few days off around Christmas.
Sorry about the delay on merging this. Thank you for adding this useful feature. :)
No problem at all. Thanks very much for merging it.
@NateEag, thanks for php-auto-yasnippet-required-files variable. Great idea.
You're quite welcome. Glad to hear you're getting some use out of it.
I was thinking it might be useful to add support for snippets for end-user functions/methods.
Maybe something like:
--require_once
option toCreate-PHP-Yasnippet.php
that callsrequire_once
for the passed path. It could be specified multiple times.php-auto-yasnippet-requires
(or something along those lines) to the elisp package, defaulting it to the empty list. Every path in it is passed to the PHP script via the new--require_once
option.Users could use .dir-locals (or other mechanisms) to set the
php-auto-yasnippet-requires
list for a given project.A lot of modern PHP projects rely on autoloads, and even the ones that don't usually have some "include all the things" option, so this should be fairly usable in practice.
I verified that adding a require_once does let the code work with user code.
Does this sound like a worthwhile addition? If I got this working, do you think you'd merge it?