Open cprn opened 8 years ago
Can you run: :! echo $PATH
in neovim and check whether composer's bin in there?
Yes, it is in the $PATH - both :echo $PATH
and :!echo $PATH
.
@cprn can you manually run $ padawan generate
in the project root?
I am also running into this issue, and can verify that Composer's bin directory is on my path.
padawan generate
works.
python << endpython
import vim
from padawan import client
filepath = vim.eval("expand('%:p')")
client.Generate(filepath)
endpython
...works
When I open empty buffer in a project directory and call :PadawanGenerateIndex
error 255 occurs but it works if I open any path or window, i.e.:
COMMAND | ACTIONS | RESULT | |
---|---|---|---|
vim |
:PadawanGenerateIndex |
Error 255 | |
vim . |
:PadawanGenerateIndex |
Success | |
vim file.php |
:PadawanGenerateIndex |
Success | |
vim |
:Explore |
:PadawanGenerateIndex |
Success |
vim |
:NERDTreeToggle |
:PadawanGenerateIndex |
Success |
Tiny detail: I use nvim
but that shouldn't matter, should it?
hm. It looks like the issue occurs when there is now file in a buffer
I can confirm that error. With no buffer loaded, I get error 255.
IMO, the problem comes from this line %
refers to the current file, which is not defined when you use vim without any argument. So the question is : how to get the current working directory when no file is opened?
@greg0ire :pwd
should work, so we just need to add check whether current file is specified. If not than use :pwd
else report error. I think this will solve the issue
Why not use :pwd
all the time?
In regards to using :pwd
all the time... Doesn't it force the user to always start vim
in project directory?
:pwd
/home/cprn/
:vsp tmp/foobar.txt " opens buffer with file in different working directory
:pwd
/home/cprn/ " even though I'm in a buffer with different directory
or do :cd
if you're switching projects
Okay... Then I find it sensible to always use :pwd
assuming you display correct error message instead of just 255
when current :pwd
isn't the project root. Alternatively in such case you can interactively ask the user where the project root is but I think it would be an overkill, :cd
should be enough.
I just installed padawan server and plugin. Running
:PadawanGenerateIndex
in root of composer project returnsError occured, code: 255
. My home dir.composer/vendor/bin
is in$PATH
, I runneovim
on Ubuntu GNOME 16.04 (up to date) and successfully calledsudo pecl install event-2.0.4.tgz
(which should provideext-event
). What else can I do? How do I debug this?