emacs-php / php-auto-yasnippets

Dynamically Generated YASnippets for PHP Code in GNU Emacs
GNU General Public License v3.0
41 stars 12 forks source link

Add support for end-user code? [idea] #12

Closed NateEag closed 10 years ago

NateEag commented 10 years ago

I was thinking it might be useful to add support for snippets for end-user functions/methods.

Maybe something like:

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?

ejmr commented 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.

NateEag commented 10 years ago

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.

ejmr commented 10 years ago

Sorry about the delay on merging this. Thank you for adding this useful feature. :)

NateEag commented 10 years ago

No problem at all. Thanks very much for merging it.

dhaley commented 10 years ago

@NateEag, thanks for php-auto-yasnippet-required-files variable. Great idea.

NateEag commented 10 years ago

You're quite welcome. Glad to hear you're getting some use out of it.