From 0fa43ca6c67dc34569be75584046581e9f4b4606 Mon Sep 17 00:00:00 2001 From: unleashy Date: Fri, 14 Mar 2025 16:45:02 -0300 Subject: [PATCH] Automatically continue doc comments taken and adjusted from https://github.com/PowerShell/vscode-powershell/blob/43c8bff8bd316684fb4bc82cdbed36ceb7988904/src/extension.ts#L80-L114 --- lang-configs/d.json | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/lang-configs/d.json b/lang-configs/d.json index 4984d85..0b2fc93 100644 --- a/lang-configs/d.json +++ b/lang-configs/d.json @@ -86,5 +86,33 @@ "start": "^\\s*//\\s*dfmt\\s*off", "end": "^\\s*//\\s*dfmt\\s*on" } - } -} \ No newline at end of file + }, + "onEnterRules": [ + { + "beforeText": "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$", + "afterText": "^\\s*\\*\/$", + "action": { "indent": "indentOutdent", "appendText": " * " } + }, + { + "beforeText": "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$", + "action": { "indent": "none", "appendText": " * " } + }, + { + "beforeText": "^(\\t|(\\ \\ ))*\\ \\*(\\ ([^\\*]|\\*(?!\\/))*)?$", + "action": { "indent": "none", "appendText": "* " } + }, + { + "beforeText": "^\\s*\\/\\+\\+(?!\\/)([^\\+]|\\+(?!\\/))*$", + "afterText": "^\\s+\\+\/$", + "action": { "indent": "indentOutdent", "appendText": " + " } + }, + { + "beforeText": "^\\s*\\/\\+\\+(?!\\/)([^\\+]|\\+(?!\\/))*$", + "action": { "indent": "none", "appendText": " + " } + }, + { + "beforeText": "^(\\t|(\\ \\ ))*\\ \\+(\\ ([^\\+]|\\+(?!\\/))*)?$", + "action": { "indent": "none", "appendText": "+ " } + }, + ] +}