Skip to content

struktJS in VS Code

struktJS also runs as an extension for desktop VS Code: the projectional editor opens .model.py and .model.js files, and VS Code's own Explorer, Problems, Test Explorer and Source Control show your project. It is installed by hand from a download; it is not published to the Marketplace or Open VSX, and it does not update itself.

Install

  1. Download struktjs-vscode-<version>.zip from the release page and unzip it.
  2. In VS Code open the Extensions view, choose ... > Install from VSIX... and pick the .vsix file. Or run code --install-extension struktjs-<version>.vsix.
  3. Reload the window when asked, then open a .model.py or .model.js file.

SHA256SUMS in the zip lists the checksum of the .vsix. To update, install the newer .vsix over the old one. The Theia IDE installs the same file with Extensions: Install from VSIX... (press F1).

What you get

Where What
Editor The projectional editor for every model file; Run, Generate and the other editor commands are in the Command Palette under struktJS.
Problems Check findings for every model of the project, with file and line, whether or not the file is open.
Explorer A struktJS Project view: project, models, roots and an outline.
Test Explorer A struktJS controller. Run it, and every test case of the project appears with its result. Cases are listed after a run, because there is no separate discovery step.
Source Control Show Node-Level Diff and Resolve Conflict by Node on a changed or conflicted model file, and the history of a single node.
Inspector Double-click a node, then More info: the Inspector opens as a panel on the right edge of the editor.
Debugger struktJS: Debug Program (or F5 on a model file) steps the program with VS Code's debugger: Variables, step in / over / out, Continue. Breakpoints are VS Code's own: open the model as text (Reopen Editor With... > Text Editor) and click the gutter. Only languages that run on struktJS's own evaluator are covered, not generated Python or JavaScript.
Live sessions struktJS: Share Model Session and Join Model Session work as in the other struktJS apps; a status bar item shows the room and who is in it. The relay is set in struktJS.collaboration.serverUrl (it must be an http(s) address; the webview is only allowed to reach that address and localhost:8100). Copy Join Link gives a vscode://struktjs.struktjs/join?... link: opening it in VS Code starts the join in the editor that is open.
Language editor struktJS: Show Language Editor opens the language of the model in its own panel.
Documentation struktJS: Open Documentation opens the offline manual in your browser.

Some views of the Theia IDE have no VS Code counterpart yet (the model console). A request for one shows a short note in the status bar instead of doing nothing.

Trust

Languages that live in your project (.lang.js) and language plugins are code. In a workspace VS Code has not trusted (Restricted Mode) only the bundled languages load and Run is refused. Trust the workspace to load the rest.

Language plugins

A language plugin is its own .vsix. Install it the same way, then open Tools > Language Plugins and click Load. See Installing and removing plugins and extensions.