BitR/ycmd-dcd

How to use it.

Opened this issue · 7 comments

How to use it.
BitR commented

If you follow the instructions in the README, you just need to start dcd-server, maybe with the -I argument like -I insert_source_folder_here and if your PATH is set up correctly, YouCompleteMe along with ycmd-dcd will use the dcd-client binary to find suggestions while you type in vim.

I use Plug and install Plug 'bsed/vim-dlang' Plug 'vim-scripts/Dutyl' and ycmd-dcd, but
ycmd-dcd can not work. Dutyl work fine.
I run dcd-server -I /snap/dmd/current/import/phobos
removed Dutyl the omifunc is empty.
then the ycmd options is '/usr/bin/python3 /home/god/.vim/plugged/youcompleteme/python/ycm/../../third_party/ycmd/ycmd --port=59959 --options_file=/tmp/tmpn1pz1k60'

BitR commented

Alright, did you create the symlink (per the README)?
You need a symlink from YouCompleteMe/third_party/ycmd/ycmd/completers/d to your ycmd-dcd directory.
My guess is that you could run: ln -s ~/.vim/plugged/ycmd-dcd ~/.vim/plugged/youcompleteme/third_party/ycmd/ycmd/completers/d

You'd need to restart vim before it works, but YouCompleteMe should now be able to handle .d files.

Why need create a symlink?, your README did not told do this.
I follow your solution, first add Plugin 'BitR/ycmd-dcd' in .vimrc and create symlink in~/.vim/plugged/youcompleteme/third_party/ycmd/ycmd/completers/ links to /home/name/.vim/bundle/ycmd-dcd/.
buf the omifunc is empty, can not work...
Ycm config:
image

BitR commented

Right, well the README states that you should clone into completers/d, in you case if you're using Plug, you'll need to create the symlink.

Anyways, do check that the symlink at ~/.vim/plugged/youcompleteme/third_party/ycmd/ycmd/completers/d resolves to this git repo.

You also need to make sure that you installed YouCompleteMe with python3 (python3 ./install.py inside the YouCompleteMe folder)

I just created a test .vimrc that works - though with vundle (for reference):

filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'

call vundle#end()
set completeopt=noinsert,menuone,preview

filetype plugin indent on

If you start dcd-server with --loglevel info and then try to use vim on a .d file, do you see any requests being processed in the log?
Also check if you get output if you run this in your shell:

echo 'void test() { int a; a.' > /tmp/dcd-test
dcd-client -c 22 /tmp/dcd-test

Tanks a lot, the dcd-server log show 'Getting completeions' but can not get any complete word.
each pass key will trigger dcd-server but can not complete.
The echo 'void test() { int a; a.' > /tmp/dcd-test dcd-client -c 22 /tmp/dcd-test return ok.
How to set dcd-server -I argument?

BitR commented

Alright, try this then:

echo 'void test() { int a; a. }' > /tmp/dcd-test.d
vim /tmp/dcd-test.d

If you replace the dot after the last a with another dot, you should get completions.
If not, check if there are any errors in /tmp/ycmd_*.log
You should also see '[dcdcompl] DCD completer loaded' in one of the logs.