Skip to content

Installing Code D

Gerald Nunn edited this page Dec 11, 2015 · 5 revisions

Installing Code-D

Installing Code-D is a multi-step process as it has dependencies on the following projects which must all be installed first:

  • Install Visual Studio Code
  • DCD
  • DScanner
  • Dfmt
  • Workspace-d

These instructions are assuming that you have not previously setup any of these dependencies.

Note that all of these dependencies are in the form of binaries which are run as external processes. Thus they must be accessible in your path. This means that you must either alter your system path to include the paths to these files or copy the files to a common location that is included in the path.

Install Visual Studio Code

Use the appropriate installation method for the OS you are using, on Linux VS Code should be available as a package in your distro's repository.

Install DCD

The install instructions for DCD are on the DCD home page located here. Once you have followed the instructions you need to configure a DCD configuration file. Note that contrary to the instructions on the DCD home page, the configuration on Posix systems is located at ~/.config/dcd/dcd.conf. In the DCD configuration file you need to specify the path to the source of the D core libraries (i.e. phobos) on your system.

Once you have edited the configuration file and ensured that dcd-server and dcd-client are available on the path, test your DCD installation by running dcd-server from the command line and make sure no errors are displayed.

Install DScanner

The install instructions for DScanner are on it's home page located here. DScanner is by the same developer as DCD and the installation instructions are very similar to DCD.

Once the binary is built, ensure it is available on the path.

Install Dfmt

The install instructions for Dfmt are on it's home page located here. Dfmt is by the same developer as DCD and DScanner the installation instructions are very similar to both.

This application formats D code to a specified standard. This standard is configured in a file called .editorconfig. If you find that the default formatting is not to your liking, try copying this file to the same location where dub.json is found and modify it as desired.

Once the binary is built, ensure it is available on the path.

Install workspace-d

This application provides a unified layer to manage DCD, dfmt and Dscanner. The home page of the application can be found here. To build the binary, simply clone the repository and run the following command:

dub build -build=release

Once the binary is built, ensure it is available on the path.

Install code-d

Use the following instructions to install code-d:

cd ~/.vscode/extensions/
git clone https://github.com/WebFreak001/code-d.git
cd code-d
npm install
node ./node_modules/vscode/bin/compile
Clone this wiki locally