Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
208 stars 49 forks source link

Serve-d keep asking for re-downloading DCD #139

Closed vushu closed 3 years ago

vushu commented 3 years ago

Hi thanks for this awesome language server :)

I am trying to implement serve-d into a coc extension I keep getting the message below every instance, even though I already have it installed.

DCD is outdated. (target=0.13.2, installed=none)
(1) Download DCD:

I can see that the files exist in:

vushu@pop-os:~/.local/share/code-d/bin$ ls
dcd-client  dcd-server  dcd-v0.13.2-linux-x86_64.tar.gz

How do I resolve this thanks.

WebFreak001 commented 3 years ago

do your settings contain the path to the code-d/bin/dcd-* files? (d.dcdServerPath, d.dcdClientPath) I don't think it tries to look there by default

vushu commented 3 years ago

Hi @WebFreak001

I am not sure about, how to do it, I tried


    const updateServerParams = {
      section: 'd.dcdServerPath',
      value: '.config/coc/coc-dlang-data',
      global: 'true'

    };

    client.sendRequest("coded/updateSetting", updateServerParams).then((data:any) => {
      window.showPrompt('something happened');

    });

I get methodNotfound Error

WebFreak001 commented 3 years ago

it's the standard LSP workspace configuration where it takes the settings from.

The client should automatically send it on startup https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration or serve-d will attempt to fetch it from the client if the configuration capability is sent by the client https://microsoft.github.io/language-server-protocol/specification#workspace_configuration

vushu commented 3 years ago

Thanks I have studied LSP a bit. I still have a little problem, serve-d tries to download dcd v.0.13.2, but It fails, I think this happens because v0.13.2 doesn't have any binaries.

the notification messages below are from listening on coded/logInstall

image

image

vushu commented 3 years ago

Hi @WebFreak001, It now works since the binaries now exists, Just a quick question: how do I setup serve-d to addImport for dub packages? Iit works for std imports, but I simply can't figure it out,

thanks.

WebFreak001 commented 3 years ago

serve-d will automatically find the dependencies, however when you add new ones you first need to download them using dub upgrade or dub build, then you have to either restart serve-d or send the served/updateImports LSP requests. (this is what is done in code-d on the little refresh button on the custom DUB dependency tree)

vushu commented 3 years ago

Thanks for answering my questions, you can close this issue :)