www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - Code completion with DCD in VS Code

reply Timo Gransch <timo.gransch web.de> writes:
Hello,

can anybody please help me get code completion in either VS Code (CodeD) or
IntelliJ IDEA (IntelliJ D Language 1.15.4) to work under Ubuntu x86-64?

For IntelliJ, I installed DCD 0.9.1-Q from d-apt, configured the installation
path under "D Tools" in the IntelliJ configuration (path is detected
automatically) and added a configuration file dcd.conf under ~/.config/dcd,
which looks like this:

/usr/include/dmd/druntime/import/
/usr/include/dmd/phobos/

Unforunately when I press the dot after an object name in the editor, I get a
random list of suggestions instead of the correct method names, please see

https://picload.org/view/ddldidri/dcd.png.html

VS Code installs it's own version of DCD. The suggestions are simply a list of
all keywords in the current file, please see

https://picload.org/view/ddldioga/dcd2.png.html

Can anybody please tell me how to fix this?

Best regards and thanks in advance,
Timo
Jan 09 2018
next sibling parent reply Tariq Siddiqui <m.tariqsiddiqui gmail.com> writes:
On Tuesday, 9 January 2018 at 21:29:30 UTC, Timo Gransch wrote:
 Hello,

 can anybody please help me get code completion in either VS 
 Code (CodeD) or IntelliJ IDEA (IntelliJ D Language 1.15.4) to 
 work under Ubuntu x86-64?

 For IntelliJ, I installed DCD 0.9.1-Q from d-apt, configured 
 the installation path under "D Tools" in the IntelliJ 
 configuration (path is detected automatically) and added a 
 configuration file dcd.conf under ~/.config/dcd, which looks 
 like this:

 /usr/include/dmd/druntime/import/
 /usr/include/dmd/phobos/

 Unforunately when I press the dot after an object name in the 
 editor, I get a random list of suggestions instead of the 
 correct method names, please see

 https://picload.org/view/ddldidri/dcd.png.html

 VS Code installs it's own version of DCD. The suggestions are 
 simply a list of all keywords in the current file, please see

 https://picload.org/view/ddldioga/dcd2.png.html

 Can anybody please tell me how to fix this?

 Best regards and thanks in advance,
 Timo
From your second snapshot, try with "import std.datetime" instead of "std.datetime.systime"
Jan 10 2018
parent Timo Gransch <timo.gransch web.de> writes:
Am Wed, 10 Jan 2018 16:10:12 +0000
schrieb Tariq Siddiqui <m.tariqsiddiqui gmail.com>:

  From your second snapshot, try with "import std.datetime" instead 
 of "std.datetime.systime"
Thanks for your answer. No change unfortunately. https://picload.org/view/ddlawlra/dcd3.png.html Best regards, Timo
Jan 10 2018
prev sibling parent reply visitor <visitor gmail.com> writes:
On Tuesday, 9 January 2018 at 21:29:30 UTC, Timo Gransch wrote:
 Hello,

 can anybody please help me get code completion in either VS 
 Code (CodeD) or IntelliJ IDEA (IntelliJ D Language 1.15.4) to 
 work under Ubuntu x86-64?
For me, on Ubuntu, i have to restart manually dcd (ctrl+P + kill DCD server or restart DCD server) AND reload import Path (ctrl+P + Reload import path). Apart that it works very well (again for me). Maybe that works for you also ... Waiting patiently for serve-d, the next iteration of Webfreak's code-d to be ready... or you can try directly serve-d, (didn't work for me last time i checked) Cheers
Jan 10 2018
parent reply Timo Gransch <timo.gransch web.de> writes:
Am Wed, 10 Jan 2018 20:13:16 +0000
schrieb visitor <visitor gmail.com>:

 For me, on Ubuntu, i have to restart manually dcd (ctrl+P + kill 
 DCD server or restart DCD server) AND reload import Path (ctrl+P 
 + Reload import path).
 Apart that it works very well (again for me).
 
 Maybe that works for you also ...
Thanks a lot! Now it does. :-) Just one correction for the archives: The keyboard shortcut is Ctrl-Shift-P. I even didn't need to reload the import path. Just "restart DCD Server" did the trick. https://picload.org/view/ddlawcoa/dcd4.png.html
 Waiting patiently for serve-d, the next iteration of Webfreak's 
 code-d to be ready...
There are several interesting things in the making concerning IDEs. DlangIDE for example has nicely working code completion and is very lightweight and easy to use, but unfortunately lacks some debugging features like custom watches. Let's see what 2018 will bring to the D community. Thanks again and best regards, Timo
Jan 10 2018
parent reply Jiyan <jiyan jiyan.info> writes:
On Wednesday, 10 January 2018 at 21:24:57 UTC, Timo Gransch wrote:
 Am Wed, 10 Jan 2018 20:13:16 +0000
 schrieb visitor <visitor gmail.com>:

 [...]
Thanks a lot! Now it does. :-) Just one correction for the archives: The keyboard shortcut is Ctrl-Shift-P. I even didn't need to reload the import path. Just "restart DCD Server" did the trick. https://picload.org/view/ddlawcoa/dcd4.png.html
 [...]
There are several interesting things in the making concerning IDEs. DlangIDE for example has nicely working code completion and is very lightweight and easy to use, but unfortunately lacks some debugging features like custom watches. Let's see what 2018 will bring to the D community. Thanks again and best regards, Timo
Can somebody tell me how it works for intelliJ? There the shortcut seems not to work :P
Jan 25 2018
parent reply Francis Nixon <13nixonf gmail.com> writes:
On Thursday, 25 January 2018 at 14:58:51 UTC, Jiyan wrote:
 On Wednesday, 10 January 2018 at 21:24:57 UTC, Timo Gransch 
 wrote:
 Am Wed, 10 Jan 2018 20:13:16 +0000
 schrieb visitor <visitor gmail.com>:

 [...]
Thanks a lot! Now it does. :-) Just one correction for the archives: The keyboard shortcut is Ctrl-Shift-P. I even didn't need to reload the import path. Just "restart DCD Server" did the trick. https://picload.org/view/ddlawcoa/dcd4.png.html
 [...]
There are several interesting things in the making concerning IDEs. DlangIDE for example has nicely working code completion and is very lightweight and easy to use, but unfortunately lacks some debugging features like custom watches. Let's see what 2018 will bring to the D community. Thanks again and best regards, Timo
Can somebody tell me how it works for intelliJ? There the shortcut seems not to work :P
I'm one of the core devs for the intellij plugin. Make sure that the following are setup: 1. You have a D project sdk, under File > Project Structure 2. If your project is a dub project make sure you have added your dependencies to the intellij project. This can be done automatically via Tools > Process D Libraries. In future releases this will be done automatically whenever dub.json/sdl is changed. 3.Dcd server and client executable paths are configured under Settings > Other Settings > D Tools. In future releases this is moving to Languages & Frameworks. The next release will also add an option to disable builtin completion, which you will probably want to do. Please note that because of the way intellij handles saving files certain dcd operations are be done synchronously which can create performance issues.We are working on this. Code completion is currently a mix of intellij code completion and dcd, symbols from dcd have a d logo next too them.
Feb 03 2018
parent reply arakan arkino <marcosdonalonso gmail.com> writes:
On Saturday, 3 February 2018 at 19:23:12 UTC, Francis Nixon wrote:
 On Thursday, 25 January 2018 at 14:58:51 UTC, Jiyan wrote:
 On Wednesday, 10 January 2018 at 21:24:57 UTC, Timo Gransch 
 wrote:
 Am Wed, 10 Jan 2018 20:13:16 +0000
 schrieb visitor <visitor gmail.com>:

 [...]
Thanks a lot! Now it does. :-) Just one correction for the archives: The keyboard shortcut is Ctrl-Shift-P. I even didn't need to reload the import path. Just "restart DCD Server" did the trick. https://picload.org/view/ddlawcoa/dcd4.png.html
 [...]
There are several interesting things in the making concerning IDEs. DlangIDE for example has nicely working code completion and is very lightweight and easy to use, but unfortunately lacks some debugging features like custom watches. Let's see what 2018 will bring to the D community. Thanks again and best regards, Timo
Can somebody tell me how it works for intelliJ? There the shortcut seems not to work :P
I'm one of the core devs for the intellij plugin. Make sure that the following are setup: 1. You have a D project sdk, under File > Project Structure 2. If your project is a dub project make sure you have added your dependencies to the intellij project. This can be done automatically via Tools > Process D Libraries. In future releases this will be done automatically whenever dub.json/sdl is changed. 3.Dcd server and client executable paths are configured under Settings > Other Settings > D Tools. In future releases this is moving to Languages & Frameworks. The next release will also add an option to disable builtin completion, which you will probably want to do. Please note that because of the way intellij handles saving files certain dcd operations are be done synchronously which can create performance issues.We are working on this. Code completion is currently a mix of intellij code completion and dcd, symbols from dcd have a d logo next too them.
For me, on Ubuntu, i have to restart manually dcd (ctrl+P + kill DCD server or restart DCD server) AND reload import Path (ctrl+P + Reload import path).
Apr 23 2019
parent reply Andre Pany <andre s-e-a-p.de> writes:
On Tuesday, 23 April 2019 at 18:24:24 UTC, arakan arkino wrote:
 On Saturday, 3 February 2018 at 19:23:12 UTC, Francis Nixon 
 wrote:
 [...]
For me, on Ubuntu, i have to restart manually dcd (ctrl+P + kill DCD server or restart DCD server) AND reload import Path (ctrl+P + Reload import path).
I make use of language server protocol in Intellij for code completion, here I use DLS. Instead of calling the DCD client executable for each request, DLS uses DCD as a library. The performance and stability difference is tremendous. Kind regards Andre
Apr 23 2019
parent Laurent =?UTF-8?B?VHLDqWd1aWVy?= <laurent.treguier.sink gmail.com> writes:
On Tuesday, 23 April 2019 at 21:19:29 UTC, Andre Pany wrote:
 I make use of language server protocol in Intellij for code 
 completion, here I use DLS. Instead of calling the DCD client 
 executable for each request, DLS uses DCD as a library. The 
 performance and stability difference is tremendous.

 Kind regards
 Andre
Using DCD as a library means any error thrown in DCD crashes DLS directly; so the stability difference may be tremendous... but not in a good way
Apr 24 2019