idanarye / vim-dutyl

Coordinate D tools to work together for you
http://www.vim.org/scripts/script.php?script_id=5003
79 stars 13 forks source link

Unable to run dutyl with DCD >= v0.8.0 #26

Open andrewbenton opened 8 years ago

andrewbenton commented 8 years ago

I am using the most recent version of vim-dutyl and I can try any version of DCD >= 0.8.0. dcd-server and dcd-client seem to still run on the command line, but not in vim. It might be related to the unix socket vs tcp socket. I can still use dutyl with DCD v0.7.5.

andrewbenton commented 8 years ago

It seems that if I launch dcd-server externally with dcd-server --tcp --port 9166 ... and then add --tcp --port 9166 to the args in runDCDOnBuffer it works again.

idanarye commented 8 years ago

I've upgraded to 0.8.0 in my machine it Dutyl works fine. What error are you seeing?

andrewbenton commented 8 years ago

I'm not seeing any errors. The problem is that I'm not seeing any completion either.

idanarye commented 8 years ago

Does :DUjump work? It's just an easier-to-debug feature, so if it doesn't work I prefer to start looking for the problem from there...

andrewbenton commented 8 years ago

:DUjump doesn't work either. I get the error Unable to find declaration for symbolwriteln`.

The file that I'm testing on has

import std.stdio;

void func() { writeln("Hello again!"); }

void main()
{
    writeln("Hello, world!");
    func();
}

When I do :DUjump on writeln it gets that unable to find error, when I do it on func(), I get a no tags file error.

idanarye commented 8 years ago

DCD is not using tags, so I guess that the first DUjump makes dcd-server crash and the second one recognizes there is no DCD server running and reverts to Dscanner. If you re-run the DCD server(with :DUDCDrestartServer) and tries it on func() first you'll get an unable to find error.

What happens when you try to find writeln from the command line(after you run dcd-server with Dutyl)?

andrewbenton commented 8 years ago

I don't think the server has crashed. On the command line, I'm able to do dcd-client --query and get a positive response back.

idanarye commented 8 years ago

dcd-client --query is not very interesting. What happens when you run this:

dcd-client --search writeln < [path-to-your-source-file]
andrewbenton commented 8 years ago

I might have found the problem. I haven't been launching DCD through dutyl. I've been launching it through systemd. When dcd switched over from defaulting to TCP to defaulting to unix sockets with the socket named as /tmp/dcd-${UID}.socket, the client and server weren't hitting the same socket because they are on different UIDs. The query that worked from dcd-client passed due to a zombie session. I'll need to check to confirm.

idanarye commented 8 years ago

If you can confirm it, I'll add it to the docs.

andrewbenton commented 8 years ago

So the problem is that as of DCD >= 0.8.0, the client and server on a *nix system try to use unix sockets. Since I was running DCD as a daemon, the socket was being created with a different name and with an inaccessible permission set. I can work around this by either launching a user-local version of the client, or adding --tcp --port 9166 to the client and server.

andrewbenton commented 8 years ago

Having found that, would you be opposed to adding an optional argument to dutyl#register#tool to pass in an arg list?

idanarye commented 8 years ago

Waaay ahead of you...

I'll add some instructions to the docs about this.