Thread overview
IntelliJ Plugin cannot get completion/DCD to work
Aug 20, 2018
Damian Sobieralski
Aug 21, 2018
Paul O'Neil
Aug 21, 2018
Damian Sobieralski
Aug 21, 2018
Damian Sobieralski
August 20, 2018
I'm a 2 day noob to Mars D.  So far I'm really liking it. I've been using VisualD for work so far.  And that works great.  However, there are times I am working on an Ubuntu machine and would like to have an IDE to use there.

I installed https://github.com/intellij-dlanguage/intellij-dlanguage via Intellij's "browse plugin" feature. All worked well.

I'm trying to get intellisense / completion to work.  I set up DCD as found:

https://github.com/dlang-community/DCD

I built via:

dub build --build=release --config=client --arch=x86_64
dub build --build=release --config=server --arch=x86_64

I created a ~/.config/dcd/dcd.conf that has:

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

in it

From the command prompt I type dcd-server

2018-08-20T18:22:39.824:main.d:main:117 Starting up...
2018-08-20T18:22:39.824:server.d:loadConfiguredImportDirs:94 Loading configuration from /home/XXX/.config/dcd/dcd.conf
2018-08-20T18:22:39.824:main.d:main:151 Listening at /run/user/1001/dcd.socket
2018-08-20T18:22:40.306:first.d:visit:497 Could not resolve location of module 'core/sys/netbsd/sys/mman'
2018-08-20T18:22:40.574:first.d:visit:418 Could not resolve location of module 'ldc/intrinsics'
2018-08-20T18:22:40.949:main.d:main:168 Import directories:
    /usr/include/dmd/druntime/import
    /usr/include/dmd/phobos
2018-08-20T18:22:40.949:main.d:main:174 114251 symbols cached.
2018-08-20T18:22:40.949:main.d:main:175 Startup completed in 1125 milliseconds.

all seems good.

I ^C (quit) that and put the correct path in Intellij's DCD setting area for the dcd client and server.

But it never seems to work.  Whenever I tap control and space on a partial thing it says "D language: no completion found".

I am running:

DMD64 D Compiler v2.081.2
IntelliJ 2018.2.1 Community Edition
D Language Intellij Plugin 1.17.1

Any ideas where to start troubleshooting this?  It's so fun to work on Windows with VisualD and I'd really like to work on Ubuntu as well. I use Intellij for Java work so it'd be great if I could get this to work on Ubuntu.

Thanks!

- Damian

August 20, 2018
On 8/20/18 6:33 PM, Damian Sobieralski wrote:

> 2018-08-20T18:22:40.306:first.d:visit:497 Could not resolve location of module 'core/sys/netbsd/sys/mman'
> 2018-08-20T18:22:40.574:first.d:visit:418 Could not resolve location of module 'ldc/intrinsics'
> 2018-08-20T18:22:40.949:main.d:main:168 Import directories:
>      /usr/include/dmd/druntime/import
>      /usr/include/dmd/phobos
> 2018-08-20T18:22:40.949:main.d:main:174 114251 symbols cached.
> 2018-08-20T18:22:40.949:main.d:main:175 Startup completed in 1125 milliseconds.

Each of the D compilers (dmd, ldc, gdc) comes with their own version of the standard libraries.  It looks like you are using LDC (the 'ldc/intrinisics' module looks like it's LDC only) and not DMD to compile your code, but the import directories are from DMD.  I would try changing the paths in ~/.config/dcd/dcd.conf to point at the LDC includes instead, which are probably at /usr/include/ldc .
August 21, 2018
On Tuesday, 21 August 2018 at 01:16:34 UTC, Paul O'Neil wrote:
> On 8/20/18 6:33 PM, Damian Sobieralski wrote:
>
>> 2018-08-20T18:22:40.306:first.d:visit:497 Could not resolve location of module 'core/sys/netbsd/sys/mman'
>> 2018-08-20T18:22:40.574:first.d:visit:418 Could not resolve location of module 'ldc/intrinsics'
>> 2018-08-20T18:22:40.949:main.d:main:168 Import directories:
>>      /usr/include/dmd/druntime/import
>>      /usr/include/dmd/phobos
>> 2018-08-20T18:22:40.949:main.d:main:174 114251 symbols cached.
>> 2018-08-20T18:22:40.949:main.d:main:175 Startup completed in 1125 milliseconds.
>
> Each of the D compilers (dmd, ldc, gdc) comes with their own version of the standard libraries.  It looks like you are using LDC (the 'ldc/intrinisics' module looks like it's LDC only) and not DMD to compile your code, but the import directories are from DMD.  I would try changing the paths in ~/.config/dcd/dcd.conf to point at the LDC includes instead, which are probably at /usr/include/ldc .

Thanks for your reply, Paul.

I didn't install ldc. Or, at least, not that I am aware of.  I installed the x86_64 dmd .deb from https://dlang.org/download.html#dmd

sudo dpkg -l dmd*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                   Version                
  Architecture             Description
+++-======================================-========================-========================-==================================================================================
ii  dmd                                    2.081.2-0              
  amd64                    Digital Mars D Compiler

sudo dpkg -l ldc*
dpkg-query: no packages found matching ldc*


Looking at my filesystem I don't see any /usr/include/ldc

What I did notice since this post is that on Windows if I built dcd via --arch=x86 (vs x86_64) the code completion does now work on Windows 10 w/ Intellij on there.

dub build --build=release --config=client --arch=x86
dub build --build=release --config=server --arch=x86

I haven't been able to get an x86 build on Ubuntu (yet) due to some linking issues at the end of the build process.  I'm wondering if my 64 bit system is missing some 32 bit libs to do that.


August 21, 2018
On Tuesday, 21 August 2018 at 10:14:57 UTC, Damian Sobieralski wrote:
> What I did notice since this post is that on Windows if I built dcd via --arch=x86 (vs x86_64) the code completion does now work on Windows 10 w/ Intellij on there.
>
> dub build --build=release --config=client --arch=x86
> dub build --build=release --config=server --arch=x86
>
> I haven't been able to get an x86 build on Ubuntu (yet) due to some linking issues at the end of the build process.  I'm wondering if my 64 bit system is missing some 32 bit libs to do that.

As a follow-up, the current Ubuntu (18.04) doesn't offer a 32 bit installation. So I installed a virtual machine of a 32 bit Ubuntu (16.04).  The dcd code completion works perfectly fine in the VM.

So it appears something goes wrong w/ the 64 bit dcd build as far as the Intellij D language plugin able to use it.