feat(language): add D language support (#728)

Register D (.d/.di) with comments, indentation, the built-in D highlighting mode, a file icon, and serve-d as its language server (dub.json/dub.sdl roots). Closes #727.

Co-authored-by: a-rookie-of-C-language <[email protected]>
This commit is contained in:
arookieofcanda-rookie-of-C-language authored and GitHub committed 2026-11-02 10:04:03 +08:00
1 parent c5ff0de1ee
commit c8cc69a56e
5 files changed
+22

No files matched your search

+1
View File
@@ -16,6 +16,7 @@ const BUILTIN: &[(&str, &str)] = &[
("cpp", include_str!("../../../languages/cpp.toml")),
("csharp", include_str!("../../../languages/csharp.toml")),
("css", include_str!("../../../languages/css.toml")),
("d", include_str!("../../../languages/d.toml")),
("dart", include_str!("../../../languages/dart.toml")),
("diff", include_str!("../../../languages/diff.toml")),
("dockerfile", include_str!("../../../languages/dockerfile.toml")),
+13
View File
@@ -0,0 +1,13 @@
id = "d"
name = "D"
extensions = ["d", "di"]
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 4, insert-spaces = true }
ui-mode = "D"
[[language-servers]]
name = "serve-d"
command = "serve-d"
root-markers = ["dub.json", "dub.sdl", "dub.selections.json"]
install-hint = "Install serve-d (https://github.com/symmetryinvestments/serve-d) and expose it as `serve-d`"
+2
View File
@@ -130,6 +130,7 @@ const ICONS = {
"file-gdscript": "openidea/fileTypes/gdscript",
"file-godot": "openidea/fileTypes/godot",
"file-gdshader": "openidea/fileTypes/gdshader",
"file-d": "openidea/fileTypes/d",
"file-dart": "openidea/fileTypes/dart",
"file-elixir": "openidea/fileTypes/elixir",
"file-erlang": "openidea/fileTypes/erlang",
@@ -878,6 +879,7 @@ const EXT_ICONS = table({
"file-gdscript": "gd",
"file-godot": "tscn tres godot import",
"file-gdshader": "gdshader gdshaderinc",
"file-d": "d di",
"file-dart": "dart",
"file-elixir": "ex exs",
"file-erlang": "erl hrl escript app.src",
+3
View File
@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g stroke-linejoin="round"><path d="M14 4C14 2.89543 13.1046 2 12 2H4C2.89543 2 2 2.89543 2 4V12C2 13.1046 2.89543 14 4 14H12C13.1046 14 14 13.1046 14 12V4Z" fill="#BA4032"/><path transform="translate(4 3.5)" d="M0.5 0.5V8.5" stroke="#2B2D30"/><path transform="translate(4 3.5)" d="M0.5 0.5H2.7C5.8 0.5 7.4 2.2 7.4 4.5C7.4 6.8 5.8 8.5 2.7 8.5H0.5" stroke="#2B2D30"/></g>
</svg>

After

Width:  |  Height:  |  Size: 474 B

+3
View File
@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g stroke-linejoin="round"><path d="M14 4C14 2.89543 13.1046 2 12 2H4C2.89543 2 2 2.89543 2 4V12C2 13.1046 2.89543 14 4 14H12C13.1046 14 14 13.1046 14 12V4Z" fill="#CE5B4C"/><path transform="translate(4 3.5)" d="M0.5 0.5V8.5" stroke="#2B2D30"/><path transform="translate(4 3.5)" d="M0.5 0.5H2.7C5.8 0.5 7.4 2.2 7.4 4.5C7.4 6.8 5.8 8.5 2.7 8.5H0.5" stroke="#2B2D30"/></g>
</svg>

After

Width:  |  Height:  |  Size: 474 B