Skip to content

Commit 919913a

Browse files
committed
make serve-d handle SDL files, support formatting
1 parent 54af16c commit 919913a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,12 @@
741741
"default": true,
742742
"markdownDescription": "Apply standard VSCode Formatting behavior to D files. Formatting on save can be configured with `#editor.formatOnSave#`"
743743
},
744+
"sdl.enableFormatting": {
745+
"type": "boolean",
746+
"scope": "resource",
747+
"default": true,
748+
"markdownDescription": "Apply standard VSCode Formatting behavior to SDL files. (e.g. dub.sdl) Formatting on save can be configured with `#editor.formatOnSave#`"
749+
},
744750
"d.overrideDfmtEditorconfig": {
745751
"type": "boolean",
746752
"scope": "resource",
@@ -848,6 +854,18 @@
848854
"scope": "resource",
849855
"default": true,
850856
"markdownDescription": "Set if the code in parens is indented by a single tab instead of two."
857+
},
858+
"sdl.whitespaceAroundEquals": {
859+
"type": "boolean",
860+
"scope": "resource",
861+
"default": false,
862+
"markdownDescription": "Set if `tag attribute=value` should be formatted to `tag attribute = value`."
863+
},
864+
"sdl.backslashTempIndent": {
865+
"type": "integer",
866+
"scope": "resource",
867+
"default": 2,
868+
"markdownDescription": "Set to how many indents should be inserted after a line-continuation with backslash."
851869
}
852870
}
853871
},

src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ async function startClient(context: vscode.ExtensionContext) {
215215
};
216216
var outputChannel = vscode.window.createOutputChannel("code-d & serve-d");
217217
let clientOptions: LanguageClientOptions = {
218-
documentSelector: <DocumentFilter[]>[mode.D_MODE, mode.DUB_MODE, mode.DIET_MODE, mode.DML_MODE, mode.DSCANNER_INI_MODE, mode.PROFILEGC_MODE],
218+
documentSelector: <DocumentFilter[]>[mode.D_MODE, mode.SDL_MODE, mode.DUB_MODE, mode.DIET_MODE, mode.DML_MODE, mode.DSCANNER_INI_MODE, mode.PROFILEGC_MODE],
219219
synchronize: {
220-
configurationSection: ["d", "dfmt", "dscanner", "editor", "git"],
220+
configurationSection: ["d", "dfmt", "dscanner", "sdl", "editor", "git"],
221221
fileEvents: [
222222
vscode.workspace.createFileSystemWatcher("**/*.d"),
223223
vscode.workspace.createFileSystemWatcher("**/dub.json"),

0 commit comments

Comments
 (0)