m2mdas / phpcomplete-extended

A fast, extensible, context aware autocomplete plugin for PHP composer projects with code inspection features.
MIT License
216 stars 23 forks source link

standalone / non composer projects #44

Open briceburg opened 9 years ago

briceburg commented 9 years ago

do you plan on supporting standalone projects? E.g. scanning vim's working directory, parsing php files?

this plugin looks great && context aware autocompletion is badly needed; just hoping I can use it on simple projects.

Thanks for your thoughts

mkusher commented 9 years ago

@briceburg you can try https://github.com/shawncplus/phpcomplete.vim for this

briceburg commented 9 years ago

@mkusher thanks for the heads up. I've tried and wasn't successful at getting context-aware completion going:. E.g.

$instance = new SomeClass();
$instance->[autocomplete menu]

where [autocomplete menu] has all the possible methods SomeClass provides.

Does it work for you?

complex857 commented 9 years ago

@briceburg, yes that should be working as long as the plugin can find the source file for SomeClass. This usually means that you will need a "tags" file for your project (unless it's defined in the same source file or a built-in).

These are usually generated with ctags (i highly recommend the patched one provided with the plugin for php code), but you can use projects like php-ctags.

Vim makes various use of these "tags" files like: jumping around, searching, previewing the tags under cursor to name a few and generally a useful thing to have around.

If you feel like hacking, you can try to make a converter from a tags file to the index format the phpcomplete-extended plugin expects. I've made the patched one collect docblocks too, so i think this should be doable.