idanarye / vim-dutyl

Coordinate D tools to work together for you

Home Page:http://www.vim.org/scripts/script.php?script_id=5003

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run dutyl with DCD >= v0.8.0

andrewbenton opened this issue · comments

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.

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.

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

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

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...

: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.

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)?

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.

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

dcd-client --search writeln < [path-to-your-source-file]

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.

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

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.

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

Waaay ahead of you...

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