From 1ebd8ebc69c4449d2b3e9ba30683011bd04a3aa7 Mon Sep 17 00:00:00 2001 From: "Alexey O. Shigarov" Date: Sat, 11 Jul 2026 11:29:41 +0800 Subject: [PATCH 1/3] docs(ide): point to vscode-rtl as the canonical home of editor tooling The VS Code extension (grammars, language configuration, snippets) moved to github.com/regtab/vscode-rtl per its plan phase 0. Remove the local copies so there is a single source of truth; ide/README.md now points there. Co-Authored-By: Claude Fable 5 --- ide/README.md | 73 +++-------- ide/vscode/language-configuration.json | 25 ---- ide/vscode/package.json | 45 ------- .../rtl-python-injection.tmLanguage.json | 86 ------------- ide/vscode/syntaxes/rtl.tmLanguage.json | 114 ------------------ 5 files changed, 19 insertions(+), 324 deletions(-) delete mode 100644 ide/vscode/language-configuration.json delete mode 100644 ide/vscode/package.json delete mode 100644 ide/vscode/syntaxes/rtl-python-injection.tmLanguage.json delete mode 100644 ide/vscode/syntaxes/rtl.tmLanguage.json diff --git a/ide/README.md b/ide/README.md index e9effeb..00e7e7f 100644 --- a/ide/README.md +++ b/ide/README.md @@ -1,65 +1,30 @@ # IDE support for RTL -This directory ships editor tooling for RTL (Regular Table Language): +Editor tooling for RTL (Regular Table Language) — the VS Code extension, the +TextMate grammars for `.rtl` files, and the injection grammars that highlight +RTL inside Python and Java string literals — lives in its own repository: -- a TextMate grammar for `.rtl` files (`vscode/syntaxes/rtl.tmLanguage.json`), -- an injection grammar that highlights RTL inside Python string literals - (`vscode/syntaxes/rtl-python-injection.tmLanguage.json`), -- a VS Code extension manifest wiring both together (`vscode/`). +**https://github.com/regtab/vscode-rtl** -The same `vscode/` directory doubles as a TextMate bundle for IntelliJ-based IDEs -(PyCharm and friends). +The extension is universal: it serves every RegTab implementation (jRegTab, +pyRegTab, future ports) and requires neither Python nor a JDK. -## VS Code +- **VS Code**: install “RTL — Regular Table Language (RegTab)” from the + VS Code Marketplace or Open VSX (extension id `regtab.rtl-language`). +- **PyCharm / IntelliJ IDEA**: register the extension directory as a TextMate + bundle (*Settings → Editor → TextMate Bundles*) — see the vscode-rtl README. -Copy (or symlink) the extension into your local extensions directory and reload: - -``` -# Windows -xcopy /E /I ide\vscode %USERPROFILE%\.vscode\extensions\regtab.rtl-language-0.1.0 - -# Linux / macOS -cp -r ide/vscode ~/.vscode/extensions/regtab.rtl-language-0.1.0 -``` - -Alternatively, package it properly with [vsce](https://github.com/microsoft/vscode-vsce): -`cd ide/vscode && npx @vscode/vsce package`, then install the produced `.vsix` via -*Extensions → … → Install from VSIX*. - -You get: - -- syntax highlighting for `*.rtl` files; -- highlighting of RTL inside Python strings for these forms: - - `RtlCompiler.compile("""…""")` / `RtlCompiler.compile('''…''')`, - - `RtlCompiler.compile("…")` / `RtlCompiler.compile('…')` (optionally raw: - `r"…"`). - -Limitation (inherent to TextMate): the opening quote must be on the same line as -`RtlCompiler.compile(`. - -## PyCharm / IntelliJ IDEA - -1. *Settings → Editor → TextMate Bundles → “+”* and select the `ide/vscode` directory. -2. `*.rtl` files are now highlighted. +## Keeping the grammar in sync -For RTL inside Python string literals, PyCharm's built-in language injection also -recognizes the line-comment marker `# language=RTL` placed on the statement — when the -IDE knows the RTL language (registered TextMate bundle or a dedicated plugin), it injects -RTL into the following literal. Support for injecting TextMate-backed languages varies by -IDE version; where unavailable, you still get `.rtl` file highlighting. +vscode-rtl is the canonical home of the RTL TextMate grammars. Any change to +the normative grammar `grammar/RTL.g4` (pinned from jRegTab) must be +accompanied by an issue/PR in vscode-rtl updating `rtl.tmLanguage.json`; +its CI runs a keyword-coverage sync-check against the pinned `RTL.g4`. ## Runtime validation Python has no compile-time annotation processor (the jRegTab counterpart is -`@RtlSource` + a `javac` processor). In pyRegTab, an invalid RTL string is reported at -call time: `RtlCompiler.compile(...)` raises `RtlCompileError` with the source position -(`line:col`), the expected tokens, and a fragment of the offending input. - -## Keeping the grammar in sync - -The TextMate grammar mirrors the tokens of the normative grammar `grammar/RTL.g4` -(pinned from jRegTab). Any change to `RTL.g4` must be accompanied by a matching update to -`vscode/syntaxes/rtl.tmLanguage.json` in the same PR. The `.rtl` grammar -(`rtl.tmLanguage.json`) and the editor configuration (`language-configuration.json`) are -copied verbatim from jRegTab; only the injection grammar and manifest differ (Python -instead of Java host language). +`@RtlSource` + a `javac` processor). In pyRegTab, an invalid RTL string is +reported at call time: `RtlCompiler.compile(...)` raises `RtlCompileError` with +the source position (`line:col`), the expected tokens, and a fragment of the +offending input. diff --git a/ide/vscode/language-configuration.json b/ide/vscode/language-configuration.json deleted file mode 100644 index 2e272e9..0000000 --- a/ide/vscode/language-configuration.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "comments": { - "lineComment": "//" - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["<", ">"] - ], - "autoClosingPairs": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "'", "close": "'", "notIn": ["string"] }, - { "open": "\"", "close": "\"", "notIn": ["string"] } - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["'", "'"], - ["\"", "\""] - ] -} diff --git a/ide/vscode/package.json b/ide/vscode/package.json deleted file mode 100644 index 8004839..0000000 --- a/ide/vscode/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "rtl-language", - "displayName": "RTL (Regular Table Language)", - "description": "Syntax highlighting for RTL — the Regular Table Language of the RegTab project — in .rtl files and inside Python string literals passed to RtlCompiler.compile(...).", - "version": "0.1.0", - "publisher": "regtab", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/regtab/pyregtab.git", - "directory": "ide/vscode" - }, - "engines": { - "vscode": "^1.75.0" - }, - "categories": [ - "Programming Languages" - ], - "contributes": { - "languages": [ - { - "id": "rtl", - "aliases": ["RTL", "Regular Table Language"], - "extensions": [".rtl"], - "configuration": "./language-configuration.json" - } - ], - "grammars": [ - { - "language": "rtl", - "scopeName": "source.rtl", - "path": "./syntaxes/rtl.tmLanguage.json" - }, - { - "scopeName": "inline.rtl-python", - "path": "./syntaxes/rtl-python-injection.tmLanguage.json", - "injectTo": ["source.python"], - "embeddedLanguages": { - "meta.embedded.block.rtl": "rtl", - "meta.embedded.line.rtl": "rtl" - } - } - ] - } -} diff --git a/ide/vscode/syntaxes/rtl-python-injection.tmLanguage.json b/ide/vscode/syntaxes/rtl-python-injection.tmLanguage.json deleted file mode 100644 index 3df9297..0000000 --- a/ide/vscode/syntaxes/rtl-python-injection.tmLanguage.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "name": "RTL in Python strings", - "scopeName": "inline.rtl-python", - "injectionSelector": "L:source.python -comment -string", - "patterns": [ - { "include": "#compile-triple-double" }, - { "include": "#compile-triple-single" }, - { "include": "#compile-single-double" }, - { "include": "#compile-single-single" } - ], - "repository": { - "compile-triple-double": { - "comment": "RtlCompiler.compile(\"\"\" ... \"\"\") — triple-double-quoted string on the same line as compile(", - "begin": "\\b(RtlCompiler)\\s*(\\.)\\s*(compile)\\s*(\\()\\s*([rR]?)(\"\"\")", - "beginCaptures": { - "1": { "name": "support.type.class.python" }, - "2": { "name": "punctuation.separator.period.python" }, - "3": { "name": "meta.function-call.python" }, - "4": { "name": "punctuation.definition.arguments.begin.python" }, - "5": { "name": "storage.type.string.python" }, - "6": { "name": "punctuation.definition.string.begin.python" } - }, - "end": "\"\"\"", - "endCaptures": { - "0": { "name": "punctuation.definition.string.end.python" } - }, - "contentName": "meta.embedded.block.rtl", - "patterns": [ { "include": "source.rtl" } ] - }, - "compile-triple-single": { - "comment": "RtlCompiler.compile(''' ... ''')", - "begin": "\\b(RtlCompiler)\\s*(\\.)\\s*(compile)\\s*(\\()\\s*([rR]?)(''')", - "beginCaptures": { - "1": { "name": "support.type.class.python" }, - "2": { "name": "punctuation.separator.period.python" }, - "3": { "name": "meta.function-call.python" }, - "4": { "name": "punctuation.definition.arguments.begin.python" }, - "5": { "name": "storage.type.string.python" }, - "6": { "name": "punctuation.definition.string.begin.python" } - }, - "end": "'''", - "endCaptures": { - "0": { "name": "punctuation.definition.string.end.python" } - }, - "contentName": "meta.embedded.block.rtl", - "patterns": [ { "include": "source.rtl" } ] - }, - "compile-single-double": { - "comment": "RtlCompiler.compile(\"...\") — single-line double-quoted string", - "begin": "\\b(RtlCompiler)\\s*(\\.)\\s*(compile)\\s*(\\()\\s*([rR]?)(\")", - "beginCaptures": { - "1": { "name": "support.type.class.python" }, - "2": { "name": "punctuation.separator.period.python" }, - "3": { "name": "meta.function-call.python" }, - "4": { "name": "punctuation.definition.arguments.begin.python" }, - "5": { "name": "storage.type.string.python" }, - "6": { "name": "punctuation.definition.string.begin.python" } - }, - "end": "(?", - "name": "keyword.operator.arrow.rtl" - }, - "range": { - "match": "\\.\\.", - "name": "keyword.operator.range.rtl" - }, - "number": { - "match": "[+-]?\\d+", - "name": "constant.numeric.rtl" - }, - "quantifier": { - "match": "[+*?]", - "name": "keyword.operator.quantifier.rtl" - }, - "operator": { - "match": "[&|!=:~^,]", - "name": "keyword.operator.rtl" - }, - "bracket": { - "match": "[\\[\\]{}()<>]", - "name": "punctuation.section.bracket.rtl" - } - } -} From 7d10c25f078e15ce67fd4b39467c6fa0da6c7d52 Mon Sep 17 00:00:00 2001 From: "Alexey O. Shigarov" Date: Sat, 11 Jul 2026 11:45:34 +0800 Subject: [PATCH 2/3] docs(ide): use the chosen extension display name "RegTab RTL" Co-Authored-By: Claude Fable 5 --- ide/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ide/README.md b/ide/README.md index 00e7e7f..552473a 100644 --- a/ide/README.md +++ b/ide/README.md @@ -9,7 +9,7 @@ RTL inside Python and Java string literals — lives in its own repository: The extension is universal: it serves every RegTab implementation (jRegTab, pyRegTab, future ports) and requires neither Python nor a JDK. -- **VS Code**: install “RTL — Regular Table Language (RegTab)” from the +- **VS Code**: install “RegTab RTL” from the VS Code Marketplace or Open VSX (extension id `regtab.rtl-language`). - **PyCharm / IntelliJ IDEA**: register the extension directory as a TextMate bundle (*Settings → Editor → TextMate Bundles*) — see the vscode-rtl README. From dbf7e0c092e51bcd4b54e237f326d603c71a4b46 Mon Sep 17 00:00:00 2001 From: "Alexey O. Shigarov" Date: Sat, 11 Jul 2026 11:54:13 +0800 Subject: [PATCH 3/3] docs(ide): extension id is regtab.rtl (decided before first publish) Co-Authored-By: Claude Fable 5 --- ide/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ide/README.md b/ide/README.md index 552473a..95e7738 100644 --- a/ide/README.md +++ b/ide/README.md @@ -10,7 +10,7 @@ The extension is universal: it serves every RegTab implementation (jRegTab, pyRegTab, future ports) and requires neither Python nor a JDK. - **VS Code**: install “RegTab RTL” from the - VS Code Marketplace or Open VSX (extension id `regtab.rtl-language`). + VS Code Marketplace or Open VSX (extension id `regtab.rtl`). - **PyCharm / IntelliJ IDEA**: register the extension directory as a TextMate bundle (*Settings → Editor → TextMate Bundles*) — see the vscode-rtl README.