]> git.lizzy.rs Git - rust.git/commitdiff
add a language configuration for VS Code
authorDusty Pomerleau <dustypomerleau@users.noreply.github.com>
Sat, 12 Dec 2020 00:31:00 +0000 (11:31 +1100)
committerDusty Pomerleau <dustypomerleau@users.noreply.github.com>
Sun, 13 Dec 2020 08:31:11 +0000 (19:31 +1100)
editors/code/language-configuration.json [new file with mode: 0644]
editors/code/package.json

diff --git a/editors/code/language-configuration.json b/editors/code/language-configuration.json
new file mode 100644 (file)
index 0000000..b20e0d9
--- /dev/null
@@ -0,0 +1,38 @@
+{
+    "comments": {
+        "lineComment": "//",
+        "blockComment": [ "/*", "*/" ]
+    },
+    "brackets": [
+        ["{", "}"],
+        ["[", "]"],
+        ["(", ")"],
+        ["<", ">"]
+    ],
+    "autoClosingPairs": [
+        { "open": "{", "close": "}" },
+        { "open": "[", "close": "]" },
+        { "open": "(", "close": ")" },
+        { "open": "\"", "close": "\"", "notIn": ["string"] },
+        { "open": "/*", "close": " */" }
+    ],
+    "autoCloseBefore": ";:.,=}])> \n\t",
+    "surroundingPairs": [
+        ["{", "}"],
+        ["[", "]"],
+        ["(", ")"],
+        ["<", ">"],
+        ["\"", "\""],
+        ["'", "'"]
+    ],
+    "indentationRules": {
+        "increaseIndentPattern": "^.*\\{[^}\"']*$|^.*\\([^\\)\"']*$",
+        "decreaseIndentPattern": "^\\s*(\\s*\\/[*].*[*]\\/\\s*)*[})]"
+    },
+    "folding": {
+        "markers": {
+            "start": "^\\s*//\\s*#?region\\b",
+            "end": "^\\s*//\\s*#?endregion\\b"
+        }
+    }
+}
index ca5f2ebc8d9c303a65a96c028ef38dae2e42851e..160a62e4678cc05d135fe528c3304739680474e0 100644 (file)
                 "extensions": [
                     ".rast"
                 ]
+            },
+            {
+                "id": "rust",
+                "extensions": [
+                    ".rs"
+                ],
+                "aliases": [
+                    "Rust",
+                    "rs"
+                ],
+                "configuration": "language-configuration.json"
             }
         ],
         "grammars": [