Authoring support for TopoScript, the DSL used by TopoNavi indoor topology maps.
Features
- TopoScript language registration.
- Syntax highlighting for maps, transports, configuration files, constraints, core expressions, comments, strings, numbers, and operators.
- Bracket, quote, and comment editing configuration.
- Diagnostics on open and save.
- Optional debounced validation while typing.
TopoScript: Preview Local Topologygraph preview for:topo-mapnodes,atomic-path, andlinear-pathedges.transportstations and station ordering.building-includessubmaps and vehicles.
Recognized Files
The extension recognizes:
*.topo*.toposcriptconfigurationroot- Extensionless files whose first line starts with
topo-map,transport,building-includes, orroot.
The upstream examples currently use extensionless files such as Floor1, MainElevator, and configuration.
Diagnostics
Set toposcript.compiler.command to run an external compiler/analyzer. The current file path is appended to the command, and stdout should be normalized JSON:
{
"diagnostics": [],
"graph": {
"nodes": [],
"edges": []
}
}
When no external command is configured, the extension uses a local fallback analyzer. It catches common authoring issues such as mismatched delimiters, unclosed strings, duplicate topo-node declarations, and unknown local node references in atomic-path and linear-path.
Settings
toposcript.compiler.command: external analyzer command.toposcript.validation.onChange: run debounced validation during edits.toposcript.validation.debounceMs: edit validation delay.toposcript.preview.layout:circleorgrid.
Development
npm install
npm run compile
Open this folder in VS Code and press F5 to launch an Extension Development Host.
Package a VSIX:
npm run package
Known Limitations
- This MVP is not an LSP implementation.
- The built-in analyzer is intentionally lightweight and does not replace the project compiler.
- Cross-file semantic checks depend on an external analyzer.
- The preview is a local topology aid, not the full TopoNavi renderer.