DCD D Language Autocomplete

Find Tips and tricks on how to better use the Zeus editor. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2471
Joined: Fri Aug 13, 2004 5:10 pm

DCD D Language Autocomplete

Post by jussij » Mon Sep 30, 2013 4:23 am

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

Image

Example of Brace Completion

Image

Example of Display Document Comment

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

Code: Select all

dcd_display_doc.py
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()
{
    TestStruct|
}
Running that display macro results in the following tooltip:

Image

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

C:\dmd2\src\phobos\std\datetime.d
and to this code location:

Code: Select all

@safe struct StopWatch
{
public:
....
Setup Instructions

To make this work do the following:
  1. Make sure you are running Zeus version 3.97t or better: http://www.zeusedit.com/download.html
  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 dcd_intellisense.py script for Dot Autocomplete
  6. Use the dcd_intellisense.py script for Brace Autocomplete
  7. Use the dcd_intellisense.py script for Autocomplete
  8. Use the dcd_goto_declaration.py 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.
Last edited by jussij on Thu Jan 30, 2014 11:11 pm, edited 3 times in total.

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 1 guest