Auto completion not working on Ubuntu 13.10
stef-k opened this issue · 11 comments
Just as the title states, additionally Sublime hangs for 1-3 seconds at each key press.
What I have done until now:
- Installed DCD client and server and made them available from my PATH.
- Cloned DKit to Sublime's packages
- Created a simple D source file to test the auto completion.
The file I am testing with is:
import std.stdio;
import std.file;
void main()
{
auto text = readText("test.txt");
writeln(text);
}
I am trying to get auto completion at writeln( or at std. or std.file.r but without any success.
Additionally
Some times at each key press Sublime hangs for 1 - 3 seconds.
I have re-installed both DKit and DCD many times.
Also while trying, i've checked if the dcd-server process runs, here is what i get:
stef@dev:~/projects$ ps aux | grep dcd
stef 13253 19.0 3.3 166880 137872 ? S 23:31 3:46 /home/stef/bin/dcd-server -I/usr/include/dmd -I/usr/local/include/d -I/usr/include/d -I/usr/include/dmd/druntime/import -I/home/stef/projects -p9166
stef 13869 0.0 0.0 0 0 ? Z 23:50 0:00 [dcd-server] <defunct>
stef 13887 0.0 0.0 4456 824 pts/0 S+ 23:51 0:00 grep --color=auto dcd
From what i see Dkit restarts the DCD server as it states in the console output but there is the <defunct>
thing which i thing is a zombified process.
Lastly here is what I get in Sublime's output:
Could not import subprocess32 module, falling back to subprocess module
Restarting DCD server...
Any thoughts?
I can see that you're including /home/stef/projects
folder completely for DCD completions. That may cause a very noticeable slowdown.
Can you try reducing the imports to only include /usr/include/d
and your current project's folder and see if this setting achieves the same result in terms of autocompletions?
If that doesn't resolve the issue, I'll look into parallelizing the autocompletion requests so that the UI doesn't freeze.
Regarding the zombie process, I'm still looking into it.
I reduced the includes just to /usr/include/d
just to try completions from the standard library but without any luck again.
As for the lagginess it seems reducing the include paths to do the job.
Still though auto completion is not available.
I'm sorry that I'm slow in my replies.
I'll have time to look more into this by the weekend.
No worries
I have just pushed a debug branch. Can you try cloning it and check the output in the console?
Having the debug output might point us to the problem.
Hi,
I am not near my PC, I will give it a try at a first chance.
Regards,
Stef K
Hi, sorry for the late response but i don't have much time lately.
I've cloned the debug branch and tested, here is a part of the debug output from the ST console. I've imported std.stdio
and waited for autocompletions for writeln()
, etc:
completions:
[]
in on_query_completions
server pid: 9435
arguments for dcd client: /home/stef/bin/dcd-client -c103 -p9166
response from dcd client:
completions:
[]
in on_query_completions
server pid: 9435
arguments for dcd client: /home/stef/bin/dcd-client -c104 -p9166
response from dcd client:
completions:
[]
in on_query_completions
server pid: 9435
arguments for dcd client: /home/stef/bin/dcd-client -c105 -p9166
response from dcd client:
completions:
[]
in on_query_completions
server pid: 9435
arguments for dcd client: /home/stef/bin/dcd-client -c106 -p9166
response from dcd client:
completions:
[]
in on_query_completions
server pid: 9435
arguments for dcd client: /home/stef/bin/dcd-client -c107 -p9166
response from dcd client:
Regards,
Stef K
Ok, I can see that there is no output from dcd client (at least not from the standard output).
I suggest three ways to go on:
-
Try the new master branch.
-
Run dcd-server and dcd-client without Sublime, test output and go from there. If you're willing to do that, these are the steps:
echo 'import std.s' > test.d
./dcd-server -I/usr/include/dmd/phobos/ -p9167
./dcd-client -c12 test.d -p9167
If you get sensible output, then it must be something in the communication between the plugin and dcd.
3. Add more logging around request_completions
function and check if there is anything coming through the standard error.
I'm thankful for your perseverance.
Sorry for the very late response but I could not find free time to work with the issue.
I've tested with the newest branches both DCD and DKit and now I get responses from dcd-server.
Assuming that it will continue to work, I am closing this issue.
Thank you for your work.
Regards,
Stef K.
Hi, just for the record, my include path on Arch Linux was "/usr/include/dlang/dmd/".
You can write it into the readme if you want (maybe it can help someone :) ).
Thanks. Added it to readme.