add plugin and fix example
Some checks failed
judge / Build judge (push) Successful in 1m8s
judge / Linux / gcc / Debug (push) Successful in 8s
judge / Linux / clang / Release (push) Successful in 10s
judge / Linux / gcc / Release (push) Successful in 10s
judge / Linux / gcc / Sanitized (push) Successful in 9s
judge / Linux / clang / Sanitized (push) Successful in 9s
judge / Linux / gcc / Debug (valgrind) (push) Successful in 22s
judge / Windows / clang / Debug (push) Successful in 40s
judge / Windows / clang / Release (push) Successful in 40s
judge / Windows / msvc / Debug (push) Successful in 45s
judge / Windows / msvc / Release (push) Successful in 43s
judge / SUMMARY (push) Failing after 2s

This commit is contained in:
2026-04-05 21:12:13 +03:00
parent 77f9bcf7f0
commit c6396a3d1d
7 changed files with 158 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
# Judge DSL — VS Code extension
Syntax highlighting for `.jdg` files (the judge test-suite DSL).
## Install (local, no marketplace)
### VS Code
Copy this directory into your extensions folder — VS Code loads it on next
restart:
```sh
# VS Code
cp -r editor/vscode-jdg ~/.vscode/extensions/jdg-language-0.1.0
```
Restart the editor, open any `.jdg` file — you should see keywords, strings,
durations highlighted.
### Package as `.vsix` (shareable)
```sh
npm install -g @vscode/vsce
cd editor/vscode-jdg
vsce package
# → jdg-language-0.1.0.vsix
```
Then in VS Code: `Extensions``...``Install from VSIX`.

Binary file not shown.

View File

@@ -0,0 +1,24 @@
{
"comments": {
"lineComment": "//"
},
"brackets": [
["{", "}"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "(", "close": ")" },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "\"\"\"", "close": "\"\"\"" }
],
"surroundingPairs": [
["{", "}"],
["(", ")"],
["\"", "\""]
],
"indentationRules": {
"increaseIndentPattern": "^.*\\{[^}]*$",
"decreaseIndentPattern": "^\\s*\\}"
}
}

View File

@@ -0,0 +1,22 @@
{
"name": "jdg-language",
"displayName": "Judge DSL (.jdg)",
"description": "Syntax highlighting for judge test-suite files",
"version": "0.1.0",
"publisher": "judge",
"engines": { "vscode": "^1.60.0" },
"categories": ["Programming Languages"],
"contributes": {
"languages": [{
"id": "jdg",
"aliases": ["Judge DSL", "jdg"],
"extensions": [".jdg"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "jdg",
"scopeName": "source.jdg",
"path": "./syntaxes/jdg.tmLanguage.json"
}]
}
}

View File

@@ -0,0 +1,83 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Judge DSL",
"scopeName": "source.jdg",
"fileTypes": ["jdg"],
"patterns": [
{ "include": "#comments" },
{ "include": "#heredoc" },
{ "include": "#string" },
{ "include": "#duration" },
{ "include": "#number" },
{ "include": "#boolean" },
{ "include": "#top-keywords" },
{ "include": "#block-keywords" },
{ "include": "#matcher-keywords" },
{ "include": "#scoring-values" },
{ "include": "#operators" },
{ "include": "#braces" },
{ "include": "#identifier" }
],
"repository": {
"comments": {
"name": "comment.line.double-slash.jdg",
"match": "//.*$"
},
"heredoc": {
"name": "string.quoted.triple.jdg",
"begin": "\"\"\"",
"end": "\"\"\"",
"patterns": [
{ "name": "constant.character.escape.jdg", "match": "\\\\[nt\\\\\"]" }
]
},
"string": {
"name": "string.quoted.double.jdg",
"begin": "\"",
"end": "\"",
"patterns": [
{ "name": "constant.character.escape.jdg", "match": "\\\\[nt\\\\\"]" }
]
},
"duration": {
"name": "constant.numeric.duration.jdg",
"match": "\\b-?\\d+(?:\\.\\d+)?(?:ms|s|m|h)\\b"
},
"number": {
"name": "constant.numeric.jdg",
"match": "\\b-?\\d+(?:\\.\\d+)?\\b"
},
"boolean": {
"name": "constant.language.boolean.jdg",
"match": "\\b(?:true|false)\\b"
},
"top-keywords": {
"name": "keyword.control.jdg",
"match": "\\b(?:build|build_linux|build_windows|build_darwin|binary|timeout|normalize_crlf|trim_trailing_ws|group|test|pattern|env|file|outFile)\\b"
},
"block-keywords": {
"name": "variable.parameter.jdg",
"match": "\\b(?:weight|scoring|wrapper|stdin|stdout|stderr|args|exitCode|input|output|dirs)\\b"
},
"matcher-keywords": {
"name": "support.function.jdg",
"match": "\\b(?:contains|matches|anyOrder|of)\\b"
},
"scoring-values": {
"name": "constant.language.jdg",
"match": "\\b(?:partial|all_or_none)\\b"
},
"operators": {
"name": "keyword.operator.jdg",
"match": "[=~]"
},
"braces": {
"name": "punctuation.section.braces.jdg",
"match": "[{}()]"
},
"identifier": {
"name": "variable.other.jdg",
"match": "\\b[A-Za-z_][A-Za-z0-9_]*\\b"
}
}
}