-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
219 lines (165 loc) · 17.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, shrink-to-fit=no">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<!-- <link rel="stylesheet" type="text/css" href="css/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="css/github-dark.css" media="screen">
<link rel="stylesheet" type="text/css" href="css/print.css" media="print"> -->
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>IntelliJ D Language</title>
<meta name="description" content="Development for the web and mobile devices"/>
<meta name="robots" content="noodp"/>
<link rel="canonical" href="https://intellij-dlanguage.github.io/" />
<meta property="og:locale" content="en_GB" />
<meta property="og:type" content="website" />
<meta property="og:title" content="IntelliJ D Language" />
<meta property="og:description" content="D support for IntelliJ IDEA" />
<meta property="og:url" content="https://intellij-dlanguage.github.io/" />
<meta property="og:site_name" content="IntelliJ D Language" />
<style>
/*body {
background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KPHJlY3Qgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9IiNCMDM5MzEiPjwvcmVjdD4KPGcgZmlsbD0iIzk4MzEyQSI+CjxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMSIgeT0iMjAiPjwvcmVjdD4KPHJlY3Qgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxIiB5PSI0MCI+PC9yZWN0Pgo8cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEiIHk9IjYwIj48L3JlY3Q+CjxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMSIgeT0iODAiPjwvcmVjdD4KPHJlY3Qgd2lkdGg9IjEiIGhlaWdodD0iMTAwIiB4PSIyMCI+PC9yZWN0Pgo8cmVjdCB3aWR0aD0iMSIgaGVpZ2h0PSIxMDAiIHg9IjQwIj48L3JlY3Q+CjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEwMCIgeD0iNjAiPjwvcmVjdD4KPHJlY3Qgd2lkdGg9IjEiIGhlaWdodD0iMTAwIiB4PSI4MCI+PC9yZWN0Pgo8L2c+CjxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJub25lIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iIzk4MzEyQSI+PC9yZWN0Pgo8L3N2Zz4=");
}*/
#content {
margin-top: 2em;
}
/*.navbar-nav-svg {
display: inline-block;
width: 1.2rem;
height: 1.2rem;
vertical-align: text-top;
}*/
</style>
</head>
<body>
<header class="navbar navbar-expand-sm navbar-dark bg-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#nav-content" aria-controls="nav-content" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Brand -->
<a class="navbar-brand" href="#">IntelliJ D Language</a>
<!-- Links -->
<div id="nav-content" class="collapse navbar-collapse justify-content-end">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="https://github.com/intellij-dlanguage/intellij-dlanguage" target="_blank" rel="noopener" aria-label="GitHub">
<svg class="" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 512 499.36" focusable="false"><title>GitHub</title><path d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z" fill="currentColor" fill-rule="evenodd"></path></svg>
</a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" href="https://twitter.com/intellij-dlanguage" target="_blank" rel="noopener" aria-label="Twitter">
<svg class="" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 512 416.32" focusable="false"><title>Twitter</title><path d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92" fill="currentColor"></path></svg>
</a>
</li> -->
<li class="nav-item">
<a class="nav-link" href="slack://channel?team=intellij-dlang&id=general" target="_blank" rel="noopener" aria-label="Slack">
<svg class="" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 512 512" focusable="false"><title>Slack</title><path fill="currentColor" d="M210.787 234.832l68.31-22.883 22.1 65.977-68.309 22.882z"></path><path d="M490.54 185.6C437.7 9.59 361.6-31.34 185.6 21.46S-31.3 150.4 21.46 326.4 150.4 543.3 326.4 490.54 543.34 361.6 490.54 185.6zM401.7 299.8l-33.15 11.05 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.38-68.36 22.92 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.43-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.5-13.92 2.87-29.06 16.78-33.56l33.12-11.03-22.1-65.9-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.48-13.93 2.89-29.07 16.81-33.58l33.15-11.05-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.46 34.38 68.36-22.92-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.47 34.42 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.87 29.06-16.78 33.56L329.7 194.6l22.1 65.9 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.88 29.07-16.81 33.57z" fill="currentColor"></path></svg>
</a>
</li>
<li class="nav-item dropdown">
<a class="nav-item nav-link dropdown-toggle" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Download Source
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="bd-versions">
<a class="dropdown-item" href="https://github.com/intellij-dlanguage/intellij-dlanguage/zipball/master">Download .zip</a>
<a class="dropdown-item" href="https://github.com/intellij-dlanguage/intellij-dlanguage/tarball/master">Download .tar.gz</a>
</div>
</li>
</ul>
</div>
</header>
<main id="content">
<div class="container">
<div class="row align-items-center">
<div class="col-6 mx-auto col-md-6 order-md-1">
<h1 class="mb-3 bd-text-purple-bright">IntelliJ D Language</h1>
<p class="lead">Support for the D programming language within IntelliJ IDEA.</p>
</div>
<div class="col-3 mx-auto col-md-3 order-md-2">
<img class="img-fluid" src="images/intellij-dlang.svg" alt="" />
</div>
</div>
<div class="row">
<div class="col-12">
<h2><a id="installation" class="anchor" href="#installation" aria-hidden="true">Installation</a></h2>
<p><a href="https://www.jetbrains.com/idea/">Download</a> and install IntelliJ IDEA (either Community Edition or Ultimate).
From IntelliJ go to Settings > Plugins > Browse Repositories and search For "D Language" - you will see 2 plugins - Choose the <em>DLanguage</em> one and click install and then click restart intellij</p>
<p>You can also download the plugin jar to your local disk here: <a href="https://plugins.jetbrains.com/plugin/8115">Jetbrains plugin repository</a> and then in intelliJ
go to Settings > Plugins > Install plugin from disk and choose the jar you downloaded</p>
<img src="images/intellij-dlanguage-install-plugin.png" class="img-fluid rounded mx-auto d-block" alt="installation"/>
<h2><a id="quick-usage" class="anchor" href="#quick-usage" aria-hidden="true"><span class="octicon octicon-link"></span></a>Quick Usage</h2>
<h4><a id="open-existing-dub-project" class="anchor" href="#open-existing-dub-project" aria-hidden="true"><span class="octicon octicon-link"></span></a>Open existing DUB project</h4>
<ul>
<li>File -> Open then choose your existing dub project folder</li>
<li>After the project loads - right click on the module (first item in the project tree on left pane) and choose Module Settings (f4)</li>
<li>In Module Setting - in the right pane in the Sources tab - locate the source directory in the tree and click it - and then click the blue sources folder at the top of the pane where it says Mark as</li>
<li>That will mark the source folder as a Source folder in intellij - and it will go blue - now intellij know where to find the source code for your dub module and you can use the run configurations now</li>
</ul>
<h4><a id="new-project-with-dub" class="anchor" href="#new-project-with-dub" aria-hidden="true"><span class="octicon octicon-link"></span></a>New Project with DUB</h4>
<ul>
<li>When you select this to create a new project with dub - if dub is on your path it will attempt to use dub init to create a new dub project for you. If dub is not on your path it will create a source directory and you will have to create your sdl/json dub file manually or rename/delete the source folder and then use dub init to recreate it</li>
<li>Or you can open an existing dub project by doing File -> Open </li>
<li>Once a dub project is loaded there is right click menu option to run with dub, or you can use the run config - run with Dub</li>
<li>Before running go and configure the DTools in Settings -> Languages & Frameworks -> D Tools</li>
</ul>
<h4><a id="configure-dtools" class="anchor" href="#configure-dtools" aria-hidden="true"><span class="octicon octicon-link"></span></a>Configure DTools</h4>
<p>For the best experience makesure to at least configure dub and dcd:</p>
<ul>
<li><a href="https://dub.pm/">DUB</a></li>
<li><a href="https://github.com/dlang-community/DCD/releases">DCD</a></li>
<li><a href="https://github.com/dlang-community/D-Scanner/releases">DScanner</a></li>
<li><a href="https://github.com/dlang-community/dfmt/releases">Dfmt</a></li>
<li><a href="https://www.sourceware.org/gdb/">GDB</a></li>
</ul>
<p>If you put these tools on your path you can go to Settings -> Languages & Frameworks -> D Tools and just click "Auto Find" on each of the tools and it will find them. Otherwise you will need to select the correct path to the tool for each one.</p>
<img src="images/intellij-dlanguage-setup-dub.png" class="img-fluid rounded mx-auto d-block" alt="installation"/>
<h4><a id="configuring-dcd" class="anchor" href="#configuring-dcd" aria-hidden="true"><span class="octicon octicon-link"></span></a>Configuring DCD</h4>
<p>On Windows, MacOS and Linux the paths to Phobos and DRuntime should be found automatically when you configure the dmd compiler. Dub dependencies can be passed to DCD by pressing the menu item "Tools -> Process D Libraries". Additional libraries can b passed to DCD by providing a comma separated list of paths in the dcd-server flags field.</p>
<img src="images/intellij-dlanguage-setup-dmd-b.png" class="img-fluid rounded mx-auto d-block" alt="installation"/>
<p>If the paths are not detected then you can manually pass them to DCD:</p>
<pre><code>/Library/D/dmd/src/phobos,/Library/D/dmd/src/druntime/import,/Users/hendriki/projects/rainbow-master/src</code></pre>
<p>This will add the phobos and druntime/import as well as add the p rainbow project.</p>
<h4><a id="dcd-server-restart-action" class="anchor" href="#dcd-server-restart-action" aria-hidden="true"><span class="octicon octicon-link"></span></a>DCD Server Restart Action</h4>
<p>I noticed that after a while the auto completion seemed to cause the editor to hang. As a first step I have added a menu action in Tools as the last option to Restart the DCD Server. This action will just kill the running process and restart it again which seems to fix the hanging issue. I will investigate further to find a way to prevent the hanging in the first place but this is a helpful restart action.</p>
<h4><a id="dformat" class="anchor" href="#dformat" aria-hidden="true"><span class="octicon octicon-link"></span></a>DFormat</h4>
<p>To reformat D code use the shortcut or the menu item - Code -> Reformat Code with D Format (ctrl+alt+K) or on mac (cmd+alt+K)</p>
<h4><a id="dfix" class="anchor" href="#dfix" aria-hidden="true"><span class="octicon octicon-link"></span></a>DFix</h4>
<p>To apply DFix to the a file use the shortcut or the menu item - Code -> Fix D code with DFi (ctrl+alt+M) or on mac (cmd+alt+M)</p>
<h4><a id="syntax-highlighting" class="anchor" href="#syntax-highlighting" aria-hidden="true"><span class="octicon octicon-link"></span></a>Syntax Highlighting</h4>
<p>Go to Settings -> Editor -> Colors and Fonts -> D File</p>
<p>You can customize the syntax highlighting colours here. Save as a new theme - and then untick the inherit from checkbox and this will allow you to choose a colour for each item.
Only the native items will show as changing in the code example. From function definition downwards the options are related to annotated highlighting which is based on the grammar and not the lexer. So these don't show as chanigng the code example but they do wok.
I created one similar to the sublime dark theme by using Darcula theme and customizing the colours here.</p>
<h4><a id="debugging" class="anchor" href="#debugging" aria-hidden="true"><span class="octicon octicon-link"></span></a>Debugging</h4>
<p>On MacOS and Linux debugging is possible using GDB. Enter in Settings -> Languages & Frameworks -> D Tools -> GDB the path to the gdb executable.</p>
<p>On Windows debugging of executables is possible using Mago-Mi. The latest version of Mago-Mi you can find on <a href="https://ci.appveyor.com/project/rainers/mago/build/artifacts">AppVeyor</a>. To debug x86_64 applications you need also MagoRemote.exe and a regedit key "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MagoDebugger" with a value "Remote_x64" containing path to "MagoRemote.exe" e.g. "C:\Program Files (x86)\VisualD\Mago\MagoRemote.exe".</p>
<p>In addition it is also possible to use Windows Subsystem for Linux to compile from Windows Linux binaries and debug them using gdb which also runs on WSL. Due to a bug in WSL you need Windows 10 1803 or later.
Create a file called dubwsl.bat with content:<br>@ECHO OFF<br>wsl dub<br><br>and a file gdbwsl.bat with content:<br>@ECHO OFF<br>wsl gdb<br><br>Set as dub path the filepath to dubwsl.bat and as gdb path the path to gdbwsl.bat.
On your WSL linux file system DMD and GDB needs to be installed.</p>
<h4><a id="language_server_protocol" class="anchor" href="#language_server_protocol" aria-hidden="true"><span class="octicon octicon-link"></span></a>Language Server Protocol</h4>
<p>The functionality of IntelliJ D plugin can be enhanced with language servers for D. For functionality Dls provides have a look here <a href="https://github.com/d-language-server/dls">Dls</a><br>
Install plugin "LSP Support" from IntelliJ marketplace.</p>
<p>Install Dls using this command<br>
dub fetch dls<br>
dub run dls:bootstrap<br>
<p>The second command will output the path to the executable you have to set in settings of plugin "LSP Support".<br>
In settings "Languages & Frameworks -> Language Server Protocol -> Server Definitions" add an entry
"Executable" with extension "d" and the path which you got from Dls.<br>
<br>
In settings "Languages & Frameworks -> Language Server Protocol -> Timeouts" set "Init" value to "60000".
</p>
</div>
</div>
</div>
</main>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
</body>
</html>