Page 1 of 1

DCD D Language Autocomplete

Posted: Mon Sep 30, 2013 4:23 am
by jussij
NOTE: Make sure you are running the latest version of Zeus (see link Setup Instructions below).

The latest version of Zeus has support for the DCD D language autocomplete client and server utilities.

NOTE: Other Zeus, D language specific features can be found here:
Using the dfmt with Zeus
Using the Dscanner (D Language) inside Zeus
Using the D Programming Language with Zeus

Example of Dot Completion


Example of Brace Completion


Example of Display Document Comment

The DCD Display Document Comment is done by this Zeus macro:

Code: Select all
To use that macro you need to bind it to a keyboard key.

Consider this sample D code where the | indicates the cursor location:

Code: Select all

module main;

import std.stdio;
import std.datetime;

* This is a D Doccumment for the TestStruct structure.
* This comment is displayed in a tool tip.
struct TestStruct
    int test;

void main()
Running that display macro results in the following tooltip:


Example of Find Declaration

Consider this code:

Code: Select all

import std.stdio;
import std.datetime;

int main(string[] args)
	StopWatch sw = StopWatch(AutoStart.yes);

	return 0;
Placing the cursor on the StopWatch word and running the goto declaration script will take you to this file:

Code: Select all

and to this code location:

Code: Select all

@safe struct StopWatch
Setup Instructions

To make this work do the following:
  1. Make sure you are running Zeus version 3.97t or better:
  2. Download an build the DCD client and server utilities
  3. Make sure the DCD client and server executables are somewhere in the PATH
  4. Start Zeus and use the Options, Document Types menu to edit the D document type, selecting the Triggers panel
  5. Use the script for Dot Autocomplete
  6. Use the script for Brace Autocomplete
  7. Use the script for Autocomplete
  8. Use the script for Goto Definition and Goto Declaration
  9. Make sure the DCD server is running
  10. Edit some D code and you should see intellisense on the dot key and the open bracket key
This latest version of Zeus also adds application starting and application closing triggers so these can be used to automatically start/stop the DCD server via trigger scripts.

Use the Options, Editor Options menu and select the editor Triggers panel.

For the Application Starting use the dcd_app_starting.lua script.

For the Application Closing use the dcd_app_closing.lua script.

With these scripts in place Zeus will manage the starting and stopping of the DCD server.