diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/support/typst.tmLanguage.json | 9 | ||||
| -rw-r--r-- | tools/test-helper/extension.js | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/tools/support/typst.tmLanguage.json b/tools/support/typst.tmLanguage.json index 74351323..8e0907f6 100644 --- a/tools/support/typst.tmLanguage.json +++ b/tools/support/typst.tmLanguage.json @@ -142,7 +142,7 @@ "captures": { "1": { "name": "punctuation.definition.reference.typst" } } }, { - "begin": "(#)(let|set|show|wrap|apply|select)\\b", + "begin": "(#)(let|set|show)\\b", "end": "\n|(;)|(?=])", "beginCaptures": { "0": { "name": "keyword.other.typst" }, @@ -253,7 +253,7 @@ }, { "name": "keyword.other.typst", - "match": "\\b(let|as|in|from|set|show|wrap|apply|select)\\b" + "match": "\\b(let|as|in|from|set|show)\\b" }, { "name": "keyword.control.conditional.typst", @@ -278,6 +278,11 @@ "match": "\\b[[:alpha:]_][[:alnum:]_-]*!?(?=\\[|\\()" }, { + "comment": "Function name", + "name": "entity.name.function.typst", + "match": "(?<=\\bshow\\s*)\\b[[:alpha:]_][[:alnum:]_-]*(?=\\s*:)" + }, + { "comment": "Function arguments", "begin": "(?<=\\b[[:alpha:]_][[:alnum:]_-]*!?)\\(", "end": "\\)", diff --git a/tools/test-helper/extension.js b/tools/test-helper/extension.js index 985112f0..253c78c7 100644 --- a/tools/test-helper/extension.js +++ b/tools/test-helper/extension.js @@ -38,12 +38,12 @@ function activate(context) { const rerunCmd = vscode.commands.registerCommand("ShortcutMenuBar.testRerun", () => { const uri = vscode.window.activeTextEditor.document.uri - const components = uri.fsPath.split('tests') + const components = uri.fsPath.split(/tests[\/\\]/) const dir = components[0] const subPath = components[1] cp.exec( - `cargo test --manifest-path ${dir}/Cargo.toml --test typeset ${subPath}`, + `cargo test --manifest-path ${dir}/Cargo.toml --all --test tests -- ${subPath}`, (err, stdout, stderr) => { console.log('Ran tests') refreshPanel(stdout, stderr) |
