VS Code support for GoX: Tree-sitter–based highlighting/folding and GoX language-server integration for completion, diagnostics, go-to-definition, and refactors across both .gox and .go files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
VS Code support for GoX: Tree-sitter–based highlighting/folding and GoX language-server integration for completion, diagnostics, go-to-definition, and refactors across both .gox and .go files.
Beta: This extension is in beta. You may encounter bugs or incomplete behavior, and features/configuration may change between releases. Please share feedback and file issues on GitHub (include your GoX version and minimal repro steps).
Features
GoX Language Server (LSP)
Language features for GoX (.gox) and Go (.go) via the GoX language server (GoX proxies gopls).
Syntax highlighting + folding
Semantic highlighting and folding powered by bundled Tree-sitter WASM grammars.
Supports GoX and Go, including common embedded languages (HTML/CSS/JS) when present.
Tool management (automatic)
Downloads the GoX language server binary (unless you provide a custom path).
Installs gopls at the pinned version using go install (unless you provide a custom path).
Requirements
For automatic gopls installation: Go toolchain (go) available in PATH.
For automatic GoX download: Windows/macOS/Linux on x64 or arm64.
Network access is required for the first-time download/install (unless you point to existing binaries).
GoX proxies gopls functionality for both .go and .gox, so VS Code’s Go extension language server must be disabled.
How it works
On activation, the extension:
Ensures gox and gopls are available (downloads/installs if missing).
Prompts to disable the VS Code Go extension language server (if it is enabled).
Starts the GoX language server for Go and GoX files.
Commands
GoX: Start (gox.start)
Starts (or restarts) the GoX language server after performing a health check. Useful after changing settings.
Settings
You can override the managed binaries and use your own installations: