Skip to content

Commit 26f617a

Browse files
committed
feat(vscode): release Virtian extension update
1 parent 967cb67 commit 26f617a

8 files changed

Lines changed: 3976 additions & 18 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ The [examples guide](docs/guides/ExamplesGuide.md) explains how examples are str
312312

313313
## Editor support
314314

315-
The official [TechScript VS Code extension](https://marketplace.visualstudio.com/items?itemName=tanmoy.techscript) provides syntax highlighting and editor integration. The extension is also available through [Open VSX](https://open-vsx.org/extension/Tcode-Motion/techscript).
315+
The official [TechScript Virtian VS Code extension](https://marketplace.visualstudio.com/items?itemName=tanmoy.techscript) provides canonical 2.0 syntax highlighting, language-server integration, debugger support, configurable save-time formatting and linting, and editor commands. The extension is also available through [Open VSX](https://open-vsx.org/extension/Tcode-Motion/techscript).
316316

317317
The language server is implemented in [`tools/lsp/`](tools/lsp). Formatter and linter implementation is in [`tools/formatter/`](tools/formatter) and [`tools/linter/`](tools/linter).
318318

‎editors/vscode/CHANGELOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
---
88

9+
## [2.0.1] — Virtian — 2026-09-15
10+
11+
### Added
12+
- Configurable format-on-save and lint-on-save actions for TechScript files.
13+
- A configurable compiler path for installations where `tsc` is not on the default PATH.
14+
- Canonical 2.0 syntax highlighting for `do`/`end` blocks, `when`, `loop`, `repeat`, `try`, `send`, `class`, `interface`, and interpolated strings.
15+
16+
### Fixed
17+
- Bundled the Language Server Protocol client required to start `techscript-lsp`.
18+
- Updated indentation rules to use canonical `end`-delimited blocks.
19+
20+
---
21+
922
## [2.0.0] — 2026-07-27
1023

1124
### 🎉 Initial Marketplace Release

‎editors/vscode/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
**The official language support extension for TechScript 2.0**
88
Syntax highlighting · IntelliSense · Diagnostics · Debugging · Formatting · Snippets
99

10-
[![Version](https://img.shields.io/badge/version-2.0.0-blue.svg)](https://github.com/Tcode-Motion/techscript/releases)
10+
[![Version](https://img.shields.io/badge/version-2.0.1--Virtian-blue.svg)](https://github.com/Tcode-Motion/techscript/releases)
1111
[![VS Code](https://img.shields.io/badge/VS%20Code-%5E1.75.0-blue.svg)](https://code.visualstudio.com/)
1212
[![Open VSX](https://img.shields.io/badge/Open%20VSX-Extension-purple.svg)](https://open-vsx.org/extension/Tcode-Motion/techscript)
1313
[![License](https://img.shields.io/badge/license-Apache--2.0-green.svg)](https://github.com/Tcode-Motion/techscript/blob/main/LICENSE)

‎editors/vscode/extension.js‎

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,22 @@ function activate(context) {
182182
})
183183
);
184184

185+
context.subscriptions.push(
186+
vscode.workspace.onDidSaveTextDocument(document => {
187+
if (document.languageId !== 'techscript') {
188+
return;
189+
}
190+
191+
const saveConfig = vscode.workspace.getConfiguration('techscript', document.uri);
192+
if (saveConfig.get('format.onSave')) {
193+
runCommand('fmt', document, false);
194+
}
195+
if (saveConfig.get('lint.onSave')) {
196+
runCommand('lint', document, false);
197+
}
198+
})
199+
);
200+
185201
// 4. Task Provider Setup
186202
context.subscriptions.push(
187203
vscode.tasks.registerTaskProvider('techscript', {
@@ -216,23 +232,24 @@ function activate(context) {
216232
context.subscriptions.push(statusBarItem);
217233
}
218234

219-
function runCommand(subcommand) {
220-
const editor = vscode.window.activeTextEditor;
221-
if (!editor) {
235+
function runCommand(subcommand, document, showTerminal = true) {
236+
const targetDocument = document || (vscode.window.activeTextEditor && vscode.window.activeTextEditor.document);
237+
if (!targetDocument) {
222238
vscode.window.showErrorMessage('No active text editor open.');
223239
return;
224240
}
225241

226-
const filePath = editor.document.fileName;
242+
const filePath = targetDocument.fileName;
243+
const compilerPath = vscode.workspace.getConfiguration('techscript', targetDocument.uri).get('compiler.path') || 'tsc';
227244
const terminal = vscode.window.activeTerminal || vscode.window.createTerminal('TechScript');
228-
terminal.show();
245+
terminal.show(showTerminal);
229246

230247
if (subcommand === 'build' || subcommand === 'check' || subcommand === 'lint' || subcommand === 'test' || subcommand === 'clean' || subcommand === 'doc') {
231-
terminal.sendText(`tsc ${subcommand}`);
248+
terminal.sendText(`${compilerPath} ${subcommand}`);
232249
} else if (subcommand === 'fmt') {
233-
terminal.sendText(`tsc fmt "${filePath}"`);
250+
terminal.sendText(`${compilerPath} fmt "${filePath}"`);
234251
} else {
235-
terminal.sendText(`tsc run "${filePath}"`);
252+
terminal.sendText(`${compilerPath} run "${filePath}"`);
236253
}
237254
}
238255

‎editors/vscode/language-configuration.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
]
7373
],
7474
"indentationRules": {
75-
"increaseIndentPattern": "^\\s*(build|model|if|else|while|each|repeat|attempt|catch)\\b.*{\\s*$",
76-
"decreaseIndentPattern": "^\\s*}\\s*$"
75+
"increaseIndentPattern": "^\\s*(do|class|struct|enum|trait|interface|when|else|loop|repeat|for|try|catch|match)\\b.*$",
76+
"decreaseIndentPattern": "^\\s*end\\s*$"
7777
},
7878
"folding": {
7979
"markers": {

0 commit comments

Comments
 (0)