简体   繁体   中英

vim php omnicompletion not showing classes

I tried setting up omnicompletion in vim for a yii project. For this, I go yii/framework folder and create ctags file with ctags-exuberant -f yii.tags --languages=PHP -R Now in .vimrc, I added the yii.tags file with :set tags=~/public_html/yii/framework/yii.tags

On opening the tags file shows all classes.

However, when I open a file and hit Cx, Co , the dropdown list contains only functions and variables. I couldn't find similar problem on the search. What could I be missing?

According to :help ft-php-omni , the default omnicomplete script for PHP (the one that is part of the standard vim distribution) only completes class names after the new keyword. Does that work?

If you want method completion to be restricted to the correct class, then you may have to add hints in the comments. The docs include the example

/* @var $myVar myClass */
$myVar->

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM