Skip to content

Commit 0225a87

Browse files
authoredFeb 21, 2023
Merge pull request #12 from foges/master
Fix indentation and formatter
2 parents d980aad + 78a1897 commit 0225a87

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed
 

‎janet.configuration.json

+11-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@
2020
["{", "}"]
2121
],
2222
"wordPattern": "[A-Za-z0-9\\!\\$\\%\\&\\*\\+\\-\\.\\/\\:\\<\\?\\=\\>\\@\\^\\_\\|\\x80-\\xFF]+",
23-
"indentationRules": {
24-
"increaseIndentPattern": "^((?!.*?\\/\\*).*\\*\/)?\\s*[\\}\\]].*$",
25-
"decreaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"
26-
}
27-
}
23+
"onEnterRules": [
24+
{
25+
"beforeText": "^[^#]*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$",
26+
"action": { "indent": "indent" }
27+
},
28+
{
29+
"beforeText": "(^[^\\[#]*\\]\\s*(#.*)?\\s*$)|(^[^\\(#]*\\)\\s*(#.*)?\\s*$)|(^[^\\{#]*\\}\\s*(#.*)?\\s*$)",
30+
"action": { "indent": "outdent" }
31+
}
32+
]
33+
}

‎out/extension.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎out/extension.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/extension.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function activate(context: vscode.ExtensionContext) {
101101
() => {
102102

103103
getREPL(true).then(terminal => {
104-
sendSource(terminal, "(import spork/fmt)(fmt/format-file \""+
104+
sendSource(terminal, "(import spork/fmt) (fmt/format-file \""+
105105
vscode.window.activeTextEditor.document.uri.fsPath.replace(/\\/g, "/")
106106
+"\")");
107107
thenFocusTextEditor();

0 commit comments

Comments
 (0)