vim-dutyl icon indicating copy to clipboard operation
vim-dutyl copied to clipboard

Unable to run dutyl with DCD >= v0.8.0

Open andrewbenton opened this issue 8 years ago • 13 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.

andrewbenton avatar Mar 26 '16 02:03 andrewbenton

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.

andrewbenton avatar Mar 26 '16 02:03 andrewbenton

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

idanarye avatar Mar 26 '16 18:03 idanarye

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

andrewbenton avatar Mar 26 '16 21:03 andrewbenton

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

idanarye avatar Mar 26 '16 21:03 idanarye

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

andrewbenton avatar Mar 26 '16 21:03 andrewbenton

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

idanarye avatar Mar 26 '16 22:03 idanarye

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.

andrewbenton avatar Mar 26 '16 23:03 andrewbenton

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

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

idanarye avatar Mar 26 '16 23:03 idanarye

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.

andrewbenton avatar Mar 26 '16 23:03 andrewbenton

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

idanarye avatar Mar 27 '16 11:03 idanarye

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 avatar Apr 07 '16 05:04 andrewbenton

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

andrewbenton avatar Apr 07 '16 05:04 andrewbenton

Waaay ahead of you...

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

idanarye avatar Apr 07 '16 12:04 idanarye