padawan-php / padawan.php

php intelligent code completion http server
http://mkusher.name/padawan/
MIT License
253 stars 30 forks source link

Shouldn't bulit-ins get completed? #67

Closed cprn closed 8 years ago

cprn commented 8 years ago

Everything works okay in most cases, e.g.:

<?php
class Foo {}
$x = new F # Padawan suggests `Foo`

But shouldn't the built-in functions (like below) get completed as well?

<?php
func_g # Padawan doesn't return suggestions
func_get_args(); # same
imagecreatetruecolor(); # same
foreach(); # same

All I get is:

Padawan.php error: Could not define empty line context

Maybe there's something wrong with my installation process?

  1. Installed NVIM-0.1.6-dev and vundle,
  2. installed deoplete, deoplete-padawan and padawan,
  3. installed composer global require mkusher/padawan,
  4. installed PHP 5.6.11.1 via sudo apt-get install php,
  5. created file foo.php, opened it with nvim and started typing.

As far as I understand, the purpose of the set omnifunc provider is to provide language syntax completion? At least phpcomplete-extended was doing that... So what am I doing wrong?

[EDITED] If I install UltiSnips and a snippets pack I get templates suggestions, so it doesn't seem to be the problem with deoplete.

mkusher commented 8 years ago

it looks more like problem with deoplete-padawan, it doesn't send prefix. Cc @pbogut

pbogut commented 8 years ago

@mkusher, your right, prefix is not sent by the deoplete-padawan. The column is always set at the beginning of the word. I wIll take a look at this later.

@cprn, which version of padawan you are using? As far as I can tell the error is displayed on stable 0.2.1 but this version doesn't support build in functions anyway.

If you want to use omnifunc with deoplete it will take async benefits away.

It will work as expected with padawan from the master branch when I fix the issue @mkusher has addressed.

cprn commented 8 years ago

which version of padawan you are using?

Whatever gets installed with vim-plug:

git log --pretty=oneline
d74aad4dcfe0ce9e5f89b79f23ad92fa6b86d0d5 Update README.md

It will work as expected with padawan from the master branch when I fix the issue @mkusher has addressed.

Sounds legit.

Do we close this issue and move to your github? (it says 0 open issues)

mkusher commented 8 years ago

@cprn yeah, it's better to continue there https://github.com/pbogut/deoplete-padawan