JetForge is a local-first VS Code extension for understanding, navigating, validating, refactoring, previewing, and generating TxtJet and Eclipse JET templates.
Install JetForge from the Visual Studio Marketplace
- Install JetForge from the Marketplace and open a TxtJet template.
- Run JetForge: Open Getting Started for the optional in-editor walkthrough.
- Run TxtJet: Select Generated Output Mode, or let filename/content detection choose Java, HTML, XML, C, Python, or LaTeX.
- Run TxtJet: Open Preview Beside Source to reach the core source-to-output workflow.
- Open JetForge Workspace in Explorer to navigate includes, skeletons, unresolved references, impact graphs, and generated targets.
Java completion, hover, and definition forwarding requires compatible installed Java tooling. The Extension Pack for Java is a practical starting point. JetForge shows local fallbacks when Java tooling cannot answer its generated virtual document.
- Default
txtjetlanguage mode for.txtjetfiles. - Also recognizes
.jet,.javajet,.htmljet,.xmljet,.cjet,.pythonjet,.texjet,.latexjet,.propertiesjet, and.jetincfiles. - Manual target modes for
txtjet-java,txtjet-html,txtjet-xml,txtjet-c,txtjet-python, andtxtjet-latex. - TextMate highlighting for JET/JSP-style blocks:
<% ... %><%= ... %><%! ... %><%@ ... %>
- Java highlighting inside embedded template blocks.
- Subtle visual differentiation for template markers, directives, embedded Java, and generated-output regions.
- Basic brackets, pairs, comments, snippets, diagnostics, and completions.
- Read-only generated output and generated Java template previews.
- Optional synchronized reveal between visible templates and generated previews where source maps are deterministic.
- On-demand generated-output writing and previous-generation diffing.
- Optional IP-XACT preview, generation, diff, validation, snippets, completions, and workspace indexing behind
txtjet.ipxact.enabled. - Outline symbols for directives, template Java blocks, expressions, declarations, and generated-output regions.
- Go to Definition and Peek Definition for
@include file="...",@jet skeleton="...", and local template Java helper methods. - Workspace-wide template, include, skeleton, unresolved-reference, and generated-target indexing in the
JetForge WorkspaceExplorer view. - Impact graph reports for templates, includes, and skeletons so project-level generated-output blast radius is visible before edits.
- Safe refactor commands to extract selected template text into
.jetincfiles and rename or move includes/skeletons while updating references. - Find All References, Rename Symbol, and Signature Help for local template Java helper methods declared in
<%! ... %>blocks. - Auto Detect support that can switch a newly opened
.txtjetfile to the likely target mode. - Remembered per-file language choices with commands to clear them.
- No runtime network access, telemetry, or proprietary template content.
Package the extension:
npm run packageRun the full local release check:
npm run verify:releaseThis checks release metadata, runs the unit/package gate and a real VS Code Extension Host smoke test, packages the VSIX, then installs that exact artifact into a clean VS Code profile for an installed-extension smoke test. Set VSCODE_TEST_VERSION=1.85.2 to run both smoke paths against the declared minimum VS Code release.
Install the generated package:
code --install-extension txtjet-syntax-0.0.21.vsixReload VSCode after installation if the language mode is not immediately available.
CI packages and installs the exact VSIX in clean Linux and Windows profiles against the minimum and current stable VS Code releases. Matching vX.Y.Z tags on main can publish that verified artifact through the protected marketplace environment and attach it with a checksum to a GitHub Release.
For help, see SUPPORT.md. Contributions should follow CONTRIBUTING.md, and vulnerabilities should be reported privately as described in SECURITY.md.
Open a .txtjet file. VSCode should select the txtjet language mode automatically.
If the generated outer content should be highlighted as a specific language, use the language mode selector and choose one of:
TxtJet Java OutputTxtJet HTML OutputTxtJet XML OutputTxtJet C OutputTxtJet Python OutputTxtJet LaTeX Output
These modes describe the generated output language outside template blocks. Embedded Java inside <% ... %>, <%= ... %>, <%! ... %>, and <%@ ... %> is highlighted in every TxtJet mode.
Template delimiters are also injected into common outer-language strings, comments, and preprocessor regions so generated C/XML/HTML/Python/Java/LaTeX text does not hide TxtJet blocks.
By default, TxtJet also applies subtle editor decorations that distinguish generated-output text from template markers, directives, and embedded Java. Run TxtJet: Toggle Region Background Coloring or disable txtjet.visualDifferentiation.enabled if a theme already provides enough contrast.
Auto Detect can infer the generated target language from filename hints and file content when a default .txtjet file is opened. It only switches files that are still in the default TxtJet mode, and it does not override a manual TxtJet ... language mode selection.
If the VSCode language selector is inconvenient, use the TxtJet commands:
TxtJet: Select Generated Output ModeTxtJet: Auto Detect Generated Output ModeTxtJet: Use Generated C Output ModeTxtJet: Use Generated Python Output ModeTxtJet: Use Generated LaTeX Output ModeTxtJet: Use Generated XML Output ModeTxtJet: Use Generated HTML Output ModeTxtJet: Use Generated Java Output ModeTxtJet: Use Generic Template ModeTxtJet: Clear Remembered Target LanguageTxtJet: Clear All Remembered Target LanguagesTxtJet: Toggle Region Background Coloring
TxtJet files also show a clickable status bar item for selecting the target language.
Manual selections are remembered for the file in the current workspace. Auto-detected choices are not remembered, so detection can be rerun after file content changes. The selector and status bar indicate whether the current mode is remembered or auto/default. Auto Detect checks filename hints before scanning content, so names like packet.c.txtjet, model.py.txtjet, schema.xml.txtjet, and report.tex.txtjet open in the expected target mode.
The JetForge Workspace Explorer view indexes workspace templates, include fragments, skeleton files, unresolved references, generated output targets, and opt-in IP-XACT templates. It understands .txtjet, .jet, .javajet, .htmljet, .xmljet, .cjet, .pythonjet, .texjet, .latexjet, .propertiesjet, .jetinc, and .skeleton files. Empty groups stay out of the way, unresolved entries open their exact source range, and generated-target entries open the corresponding generated-output preview.
Use these commands for project-level workflows:
TxtJet: Refresh Workspace ModelTxtJet: Open Including TemplateTxtJet: Open Generated Java For TemplateTxtJet: Validate Workspace TemplatesJetForge: Set Up and Test Compiler ToolchainTxtJet: Open IP-XACT TemplateTxtJet: Show Impact GraphTxtJet: Extract Selection to IncludeTxtJet: Rename or Move Include/Skeleton
Workspace indexing reuses the resource-scoped txtjet.resolution.includePaths and txtjet.resolution.skeletonPaths, so each folder in a multi-root workspace can resolve its own project layout and unresolved diagnostics update when referenced files are created, deleted, or changed. Compiler, generation, and IP-XACT settings follow the same per-resource configuration model. The generated Java preview URI is stable per source template and remains the bridge to installed Java tooling, while the local workspace class index supplies deterministic cross-template IntelliSense even when that tooling ignores virtual documents.
Impact graph reports open in the rendered Markdown preview and show direct and transitive Mermaid edges from a changed include, skeleton, or template to affected templates and generated-output targets. The refactor commands rebuild the workspace model from current open buffers before editing and fail closed if any resolved reference cannot be mapped. Extraction creates a new workspace-local .jetinc; include/skeleton rename or move uses a confirmed WorkspaceEdit that updates only resolved references in the current workspace model.
You can rerun detection manually with the command:
TxtJet: Auto Detect Generated Output ModeSnippets are available in all TxtJet modes:
scriptletexprdecljetincludeifforipxactipxact-componentipxact-busInterfaceipxact-memoryMapipxact-addressBlockipxact-registeripxact-field
The extension reports lightweight TxtJet syntax diagnostics:
- unclosed
<% ... %>blocks - unexpected
%>delimiters - malformed or empty directives
- unterminated quoted strings inside directives
Completions are available for template markers after typing <, plus directive names, common directive attributes, configured project metadata attributes, and directive values inside <%@ ... %> blocks. Directive value completions suggest local include files, skeleton files, common Java imports, reasonable @jet package/class values, and ipxact metadata values without scanning broadly outside the template directory and configured resolution paths. Inside scriptlet, expression, and declaration blocks, JetForge forwards completion, hover, and Go to Definition requests through the generated Java preview to installed Java tooling, with local fallback completions when external Java tooling does not answer virtual preview documents. Local helper methods declared in <%! ... %> blocks also support Find All References, conservative Rename Symbol, and Signature Help for direct helper calls and this.helper(...) calls. Generated-output regions get local fallback suggestions for Java, Python, and C/C++ when the selected or detected output mode matches. Matched IP-XACT generated-output regions also offer local XML node snippets for common IP-XACT elements.
Hover text identifies whether the current region is generated output, a TxtJet marker, directive syntax, or embedded template Java.
Quick Fix actions are available for common diagnostics, including unexpected closing delimiters, missing closing delimiters, empty or malformed directive names, and unterminated directive strings. Missing-reference file creation is limited to the current workspace or explicitly configured include/skeleton roots.
Additional directive diagnostics report duplicate @jet directives, missing or unresolved include files, malformed directive attributes, and unknown core directive names.
Diagnostics, Quick Fixes, completions, Java IntelliSense forwarding, and the status bar selector can be disabled from VSCode settings if a workspace needs a quieter editor.
Compiler-backed diagnostics are available through TxtJet: Validate Template With External Compiler. The command reuses txtjet.compiler.command, parses stdout/stderr with txtjet.diagnostics.compiler.problemMatcher, and maps diagnostics from the generated Java/output file back into the source template when the preview source map can do so deterministically. External compiler commands are capped by txtjet.compiler.timeoutMs, which defaults to 60000 ms. txtjet.diagnostics.compiler.runOnSave can run this validation after saves; it is disabled by default so slow compiler pipelines stay explicit.
External compiler and IP-XACT validator commands are disabled while VSCode is in Restricted Mode. Editing, highlighting, workspace-local previews, local generation, and navigation remain available without Workspace Trust. Workspace settings cannot redirect include/skeleton reads or generated writes outside the workspace until it is trusted.
Example compiler commands:
{
"txtjet.compiler.command": "java -jar tools/jet-compiler.jar ${file} ${outputFile}",
"txtjet.diagnostics.compiler.problemMatcher": "^(?<file>.*?):(?<line>\\d+):(?<column>\\d+):(?:\\s*(?<severity>error|warning|info|information|hint):)?\\s*(?<message>.+)$"
}{
"txtjet.compiler.command": "./scripts/validate-template.sh ${file} ${workspaceFolder} ${outputFile}",
"txtjet.diagnostics.compiler.problemMatcher": "^\\[txtjet\\]\\s+(?<file>.*?):(?<line>\\d+):(?<column>\\d+):\\s*(?<severity>error|warning|info|information|hint):\\s*(?<message>.+)$"
}Plain javac and Eclipse JET-style output such as generated/Sample.java:12:5: error: message works with the default matcher. If a tool emits the severity on a following line, wrap it with a small local script that prints one diagnostic per line in the default format.
IP-XACT support is disabled by default. Enable txtjet.ipxact.enabled, then match templates with txtjet.ipxact.templateGlobs or add ipxact="true" to the first @jet directive:
<%@ jet ipxact="true" package="demo.ipxact" class="ComponentTemplate" %>When enabled, these commands become available:
TxtJet: Open IP-XACT PreviewTxtJet: Generate IP-XACT OutputTxtJet: Diff Current IP-XACT Output Against Last GenerationTxtJet: Validate IP-XACT OutputTxtJet: Open IP-XACT Template
IP-XACT preview and generation reuse the generated-output transformer in XML mode. Generation writes to txtjet.ipxact.outputDirectory; validation runs txtjet.ipxact.validation.command against an isolated temporary XML output so overlapping runs cannot overwrite the canonical generated file. The validation command supports ${file}, ${workspaceFolder}, and ${outputFile} placeholders. Diagnostics are parsed with txtjet.ipxact.validation.problemMatcher and mapped back to the template only where generated-output source maps are deterministic.
TxtJet can open local, read-only preview documents for the active template:
TxtJet: Open Generated Output PreviewTxtJet: Open Generated Java Template PreviewTxtJet: Open Preview Beside SourceTxtJet: Open Region In Generated PreviewTxtJet: Open Region In Java PreviewTxtJet: Reveal Generated Output Preview From SourceTxtJet: Reveal Source From PreviewTxtJet: Open Synchronized PreviewTxtJet: Toggle Preview SynchronizationTxtJet: Generate Output FileTxtJet: Diff Current Output Against Last GenerationTxtJet: Clear Generated Output SnapshotsTxtJet: Compile Template With External CompilerTxtJet: Validate Template With External Compiler
The generated output preview preserves outer template text, expands relative includes, keeps directives, scriptlets, and declarations visible as language-appropriate comments/placeholders, and renders expressions as readable or syntax-friendly placeholders. Open unsaved include buffers take precedence over their on-disk contents, and already-open root previews refresh when an included file changes. The preview language follows the selected or detected generated-output mode.
The generated Java template preview approximates the Java class that a template compiler would produce. It uses @jet package, class, and imports attributes when present, turns declarations into class members, scriptlets into method-body Java, expressions into stringBuffer.append(...), and outer text into escaped append calls. If @jet skeleton="..." points to a local .skeleton file, the preview renders through explicit skeleton tokens: ${packageDeclaration}, ${imports}, ${class}, ${members}, and ${generateMethod}; open unsaved skeleton buffers take precedence over disk and refresh dependent previews immediately. It is intended for editor inspection and future mapping work, not as a byte-for-byte Eclipse JET compiler output.
Relative include references can be opened through Go to Definition from file="..." attributes, and @jet skeleton="..." references resolve the same way. Template Java calls such as helper(...) and this.helper(...) can Go to Definition or Peek Definition to matching helper methods declared in <%! ... %> blocks, including multiple overload locations when present. Those local helpers also support Find All References, Rename Symbol, and Signature Help where source/edit mappings stay deterministic.
JetForge also indexes workspace templates that declare an @jet class. Inside another template's Java blocks, receiver types from fields, locals, parameters, constructors, static class calls, and simple return-value chains can resolve to that workspace class. Completion then shows its accessible <%! ... %> methods and overloads; Hover, Signature Help, and Go to Definition use the same index. A CodeLens above the current @jet class shows how many other workspace template classes it references and opens a navigable class list. Try the paired examples/cross-class-consumer.txtjet and examples/cross-class-service.txtjet files.
Hover also shows resolved/unresolved include and skeleton status plus region context for template syntax. Missing local include/skeleton diagnostics offer a Quick Fix to create the referenced file. Reveal commands use the preview source map to jump between a source selection and the corresponding generated-output preview region, or back from an open preview to its source template.
Include and skeleton resolution starts relative to the current template, then checks configured txtjet.resolution.includePaths and txtjet.resolution.skeletonPaths. Reads are canonically contained to the workspace or explicitly configured roots, including protection against .. and symlink escapes. Extensionless references also try .txtjet, .jetinc, and .skeleton candidates.
Region preview commands use the cursor position to choose the mapped source range: generated-output regions open in the generated output preview, while scriptlet, expression, and declaration regions open in the generated Java preview.
TxtJet: Generate Output File writes the current generated-output approximation to txtjet.generation.outputDirectory using the selected or detected output language. Workspace-relative source directories and the original template filename are preserved, so sources in different directories or sibling files such as component.txtjet and component.javajet always produce distinct targets instead of overwriting each other. TxtJet: Diff Current Output Against Last Generation compares the current output with a bounded local snapshot; use TxtJet: Clear Generated Output Snapshots to remove all retained snapshots.
TxtJet: Compile Template With External Compiler runs a user-configured shell command (txtjet.compiler.command) so teams can invoke Eclipse JET (or another real template compiler) and inspect the true generated output beside the template.
TxtJet: Validate Template With External Compiler runs the same command without requiring a preview to be open, parses compiler problems, and reports mapped diagnostics in the .txtjet editor. Superseded validation processes are aborted and their results are discarded, so an older slow run cannot restore stale diagnostics after a newer edit or save. The default matcher supports file:line:column: severity: message and file:line:column: message; customize txtjet.diagnostics.compiler.problemMatcher for compiler-specific output. TxtJet: Open Synchronized Preview opens the generated output preview beside the template and enables txtjet.previews.synchronizedReveal.enabled, which synchronizes visible source and preview selections only where mappings are known.
TxtJet modes include conservative indentation rules for common control blocks such as:
<% if (condition) { %>
...
<% } %>VSCode document formatting and format selection also normalize directive attributes, expression spacing, and Java block indentation without changing generated-output text.
Version 1 does not implement a full Java parser or type checker. Workspace cross-class IntelliSense is a deterministic local index of @jet class templates and methods declared in <%! ... %> blocks; external .java dependencies and advanced Java expressions still depend on installed Java tooling. Java IntelliSense forwarding only runs where a TxtJet source position can be mapped into the generated Java preview. Local helper References and Rename Symbol remain intentionally conservative and only cover helper declarations in <%! ... %> plus direct or this. call sites. Generated-output suggestions for Java, Python, and C/C++ are local fallbacks, not full language-server results. Auto Detect target detection is heuristic and may guess wrong on ambiguous mixed-output templates.
Visual differentiation is parser-backed and local to the editor; it does not change generated output or replace target-language language servers.
Further IntelliSense work is tracked in docs/INTELLISENSE_ROADMAP.md. The production validation checklist is in docs/QA_CHECKLIST.md.
Settings:
txtjet.autoDetect.enabledtxtjet.defaultTargetLanguagetxtjet.diagnostics.enabledtxtjet.diagnostics.severitytxtjet.diagnostics.maxFileSizeKbtxtjet.diagnostics.generatedJava.enabledtxtjet.diagnostics.compiler.enabledtxtjet.diagnostics.compiler.runOnSavetxtjet.diagnostics.compiler.problemMatchertxtjet.codeActions.enabledtxtjet.completions.enabledtxtjet.completions.directiveMetadatatxtjet.javaIntelliSense.enabledtxtjet.statusBar.enabledtxtjet.previews.enabledtxtjet.previews.openBesidetxtjet.previews.generatedJava.enabledtxtjet.previews.synchronizedReveal.enabledtxtjet.navigation.includeDefinitions.enabledtxtjet.resolution.includePathstxtjet.resolution.skeletonPathstxtjet.formatting.enabledtxtjet.visualDifferentiation.enabledtxtjet.generation.outputDirectorytxtjet.compiler.commandtxtjet.compiler.timeoutMstxtjet.ipxact.enabledtxtjet.ipxact.templateGlobstxtjet.ipxact.outputDirectorytxtjet.ipxact.generation.autoOpentxtjet.ipxact.validation.commandtxtjet.ipxact.validation.problemMatchertxtjet.ipxact.validation.runOnSavetxtjet.ipxact.validation.timeoutMs
Privacy:
- The extension runs locally inside VSCode.
- It does not send source files, template content, diagnostics, or usage data anywhere.
- Configured external compiler and validator commands run only in trusted workspaces.
- Previous-generation diffs retain at most 20 local workspace snapshots per workflow, with a 1 MB limit per snapshot;
TxtJet: Clear Generated Output Snapshotsremoves them immediately.
The examples/ folder contains sanitized templates for manual testing:
sample-*.txtjetcover the supported generated-output modes.include-main.txtjetandpartials/*.txtjettest relative include navigation.skeleton-directive.txtjet,skeleton-nested.txtjet,skeleton-invalid-path.txtjet, andtemplates/*.skeletontest skeleton rendering, navigation, and validation.java-declaration-heavy.txtjetstresses generated Java preview declarations and imports.diagnostics-directives.txtjetintentionally triggers directive diagnostics.fallback-java-preview.txtjettests fallback generated Java metadata.ipxact-component.txtjettests opt-in IP-XACT preview, snippets, generation, and validator mapping.
MIT
