Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it. #1

Open
lilijreey opened this issue Oct 11, 2019 · 7 comments
Open

How to use it. #1

lilijreey opened this issue Oct 11, 2019 · 7 comments

Comments

@lilijreey
Copy link

No description provided.

@BitR
Copy link
Owner

BitR commented Oct 11, 2019

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.

@lilijreey
Copy link
Author

lilijreey commented Oct 13, 2019

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'

@lilijreey lilijreey changed the title How to use How to use it. Oct 13, 2019
@BitR
Copy link
Owner

BitR commented Oct 13, 2019

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.

@lilijreey
Copy link
Author

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
Copy link
Owner

BitR commented Oct 14, 2019

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

@lilijreey
Copy link
Author

lilijreey commented Oct 14, 2019

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
Copy link
Owner

BitR commented Oct 26, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants