support for frameworks/library keywords?
bitwombat opened this issue · 4 comments
Thanks for this project Shawn!
I'm trying to include Zend Framework 2's keywords in my list of completion candidates.
Currently I'm using phpcomplete with Omnicomplete and ctags with 'complete' (via dictionary) separately. It's awkward.
- Type Abstract[tab]
- Omnicomplete tells me "pattern not found" (in the currently open buffers)
- Slap forehead for not remembering this always happens
- Hit Ctrl-N to use the exuberant ctags file I generated for ZF2 that's in my project root
- Nothing happens. Slap forehead for not remember that this always happens. Also try to slap Vim for silently failing for No Good Reason. Realize Vim is just a program.
- Backspace
- type "t" and then Ctrl-N
- Get nice list of all of ZF2's Abstract classes.
Surely I'm doing this wrong? Should/does phpcomplete look up tags in frameworks too?
it'll complete any classes that are inside the tags file. When you're generating the tags just do it from your project root recursively, if the Zend classes are in vendor/ or lib/ or whatever those will be picked up, no need to have separate tags files. Just use omnicompletiong, no need to use dictionary completion for one and omnicompletion for another.
I tend to use composer so my framework/library classes are in vendor/ and they're picked up fine. Just remember to specify the fully qualified class name (including namespace) if you haven't put the use statement in yet
That makes sense, thanks.
Do you know if the out from exuberant ctags is also usable by phpcomplete or only the ctags fork you reference in your docs?
You have to use the fork from the docs if you want to reference code with namespaces which almost certainly you do. Once you build the fork you use it just like normal ctags
Beaut, many thanks.