padawan-php / padawan.vim

A vim plugin for padawan.php completion server
MIT License
79 stars 6 forks source link

Cannot Execute Padawan Commands in Vim #5

Closed ruskiyos closed 9 years ago

ruskiyos commented 9 years ago

I use Vundle to install plugins.

I added Plugin 'mkusher/padawan.vim' to my vimrc and installed plugins. Then i ran ./install.sh which completed without errors (as far as I can tell).

However, vim doesn't find any of the Padawan Commands. :PadawanGenerateIndex :PadawanStartServer etc

mkusher commented 9 years ago

@ruskiyos have you run ./install.sh script? For Vundle you should do it manually. Plugin requires vim with +python, :echo has("python") shoud print 1

ruskiyos commented 9 years ago

I verified that I have +python support.

I ran this a few time. Are the warnings relevant?

$ ./install.sh 
#!/usr/bin/env php
All settings correct for using Composer
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/etc/pki/tls/certs) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/etc/ssl/certs) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/etc/ssl) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/usr/local/share/certs) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/usr/ssl/certs) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/opt/local/share/curl) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/usr/local/share/curl) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/usr/share/ssl/certs) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
PHP Warning:  is_dir(): open_basedir restriction in effect. File(/etc/ssl) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in - on line 834
PHP Stack trace:
PHP   1. {main}() -:0
PHP   2. process() -:14
PHP   3. installComposer() -:112
PHP   4. HttpClient::getSystemCaRootBundlePath() -:365
PHP   5. is_dir() -:834
Downloading...

Composer successfully installed to: /home/john/.vim/bundle/padawan.vim/composer.phar
Use it: php composer.phar
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package guzzle/parser is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Generating autoload files
mkusher commented 9 years ago

Yeah, looks like server installed successfully. However install script doesn't connected with vim commands. I'm not sure, but the only idea for me is trying to restart vim...

ruskiyos commented 9 years ago

Is there a way I can manually register the commands?

mkusher commented 9 years ago

@ruskiyos https://github.com/mkusher/padawan.vim/blob/master/autoload/padawan.vim#L161 you can do it same way. Does padawan function accessible with :call padawan#StartServer()?

ruskiyos commented 9 years ago

:call padawan#StartServer() doesn't return any errors, so I assume it's fine. :call padawan#GenerateIndex() returns --> "Error occured, code: 255"

mkusher commented 9 years ago

Can you run padawan cli manually? For generating index do:

$ cd path/to/composer/php/project
$ ~/.vim/bundle/padawan.vim/padawan.php/bin/cli generate
ruskiyos commented 9 years ago

Yes. That worked. It's still running, but it looks like it's building the index file without any issues.

ruskiyos commented 9 years ago

Could it possibly be script permission issues?...

mkusher commented 9 years ago

@ruskiyos ok, restart padawan server after generating index. No, it doesn't looks like permission issue.

ruskiyos commented 9 years ago

Okay... I don't think it's working... I wonder if there is just something messed up with my setup... The index was generated successfully. I have YouCompleteMe as my autocompletion engine. I added the semantic triggers in the ReadMe, but I don't see any differences when the auto-completion popup shows up...

mkusher commented 9 years ago

Can you post your vimrc?

ruskiyos commented 9 years ago
set nocompatible              " be iMproved, required
filetype off                  " required

syntax on

colorscheme torte

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'

" Autocompletion plugin
Plugin 'Valloric/YouCompleteMe'

" emmet autocomplete
Plugin 'mattn/emmet-vim'

" vdebug
Bundle 'joonty/vdebug.git'
let g:vdebug_options = {
\   "break_on_open" : 0,
\}

" php laravel autocompletion
"Plugin 'shawncplus/phpcomplete.vim'
"Bundle 'Shougo/vimproc'
"Bundle 'Shougo/unite.vim'
"Bundle 'm2mdas/phpcomplete-extended'
"Bundle 'm2mdas/phpcomplete-extended-laravel'

" attempt 2
Plugin 'mkusher/padawan.vim'

let g:ycm_semantic_triggers = {}
let g:ycm_semantic_triggers.php =
                        \ ['->', '::', '(', 'use ', 'namespace ', '\']

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
ruskiyos commented 9 years ago

Another question. How exactly is the the plugin supposed to work? The youtube video show that it finds classes along with namespaces and injects it into the "autocompletion" engine..

I'm wondering if the issues are just my "user error". In summary, does your plugin just crawl the generated "autoload" file and build a definition of class names to paths?

mkusher commented 9 years ago

@ruskiyos hi, sorry for the late reply. I tried running vim with your config and everything worked perfectly(except colors). I had all padawan's commands and autocompletion with ycm working. snapshot394

mkusher commented 9 years ago

@ruskiyos can you move you .vim folder somewhere(e.g. .vim-backup), create new one with such minimal configuration, then install Vundle and try one more time?

set nocompatible              " be iMproved, required
filetype off                  " required
syntax on
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'mkusher/padawan.vim'
call vundle#end()            " required
filetype plugin indent on    " required
ruskiyos commented 9 years ago

@mkusher sorry about my delay as well. ran out of time this week :( I renamed vim directory, and installed, and ran Vundle with your vim file. No results, so I manually generated the index using the cli command posted above. Still nothing, so I installed YCM with vundle.

I'm running an Arch build

 Linux archhost 4.1.6-1-ARCH x86_64 GNU/Linux

Python:

Python 2.7.10
Python 3.4.3

Running vim -V

Executing BufEnter Auto commands for "*"
autocommand sil call s:LocalBrowse(expand("<amatch>"))
Executing VimEnter Auto commands for "*"
Press ENTER or type command to continue
autocommand call youcompleteme#Enable()
Press ENTER or type command to continue
Searching for "autoload/youcompleteme.vim" in "/home/john/.vim,/home/john/.vim/bundle/Vundle.vim,/home/john/.vim/bundle/YouCompleteMe,/home/john/.vim
/bundle/padawan.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/home/john/.vim/after,/home/john/.vim/bundle/Vundle.vi
m,/home/john/.vim/bundle/Vundle.vim/after,/home/john/.vim/bundle/YouCompleteMe/after,/home/john/.vim/bundle/padawan.vim/after"
Press ENTER or type command to continue
Searching for "/home/john/.vim/autoload/youcompleteme.vim"
Press ENTER or type command to continue
Searching for "/home/john/.vim/bundle/Vundle.vim/autoload/youcompleteme.vim"
Press ENTER or type command to continue
Searching for "/home/john/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim"
Press ENTER or type command to continue
chdir(/home/john/.vim/bundle/YouCompleteMe/autoload)
Press ENTER or type command to continue
fchdir() to previous dir
Press ENTER or type command to continue
line 0: sourcing "/home/john/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim"
Press ENTER or type command to continue
finished sourcing /home/john/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
Press ENTER or type command to continue
continuing in VimEnter Auto commands for "*"
Press ENTER or type command to continue
Executing VimEnter Auto commands for "*"
Press ENTER or type command to continue
autocommand sil call s:VimEnter(expand("<amatch>"))
Press ENTER or type command to continue
Executing CursorMoved Auto commands for "*"
Press ENTER or type command to continue
autocommand call s:Highlight_Matching_Pair()
Press ENTER or type command to continue
Executing CursorMoved Auto commands for "*"
Press ENTER or type command to continue
autocommand call s:OnCursorMovedNormalMode()
Press ENTER or type command to continue

This still happens if I run

:call padawan#GenerateIndex() returns --> "Error occured, code: 255" 
mkusher commented 9 years ago

@ruskiyos I found it! Just open any php file in your project :)

ruskiyos commented 9 years ago

Awesome! Thanks for all your help.

Just as a side note, I installed most recent version of padawan, and would've preferred that the installation didn't require a global composer path, but other than that, plugin now installs without issues and runs great.