Zero B Language Support for Visual Studio Code & Cursor
Official language extension for Zero B, the ultra-fast bare-metal programming language with Pure Pythonic syntax, 100% Zero-Unsafe architecture, and ARM64 NEON SIMD acceleration.
Key Features
- Native LSP 3.17 Integration (
zbc --lsp):
- Real-Time Inlay Type Hints: Automatically computes and renders inferred types (
: int, : ptr, : Vec[T]) directly in the editor in real-time.
- Compiler Diagnostics: Instant red squiggly error reporting for syntax, unknown identifiers, and type mismatches.
- Go To Definition (
F12) & References (Shift+F12): Instant navigation across symbols.
- Document Formatting (
Shift+Option+F): Standardized 4-space indentation and layout formatting.
- Smart Rename (
F2): Safe semantic renaming of local variables and parameters.
- Markdown Hover Docs: Rich type signatures and documentation on mouse hover.
- Pure Pythonic Syntax Highlighting: Clean indentation-block highlighting (
:), shorthand types (ptr, rawptr, size, str), and keyword coloration.
- Hardware SIMD & Intrinsics: Full semantic coloring for
zb_vec_*, zb_store*, zb_load*, and wrapping arithmetic operators (+%, -%, *%).
- CodeLens One-Click Run: "▶ Run Zero B Target" button above
fn main() for instant execution.
- Language Configuration & Snippets: Smart indentation rules, auto-closing brackets, and fast code templates.
Configuration Settings (.vscode/settings.json)
{
"editor.inlayHints.enabled": "on",
"zerob.compilerPath": "${workspaceFolder}/zerob_language/zbc",
"zerob.sdkRoot": "${workspaceFolder}/zerob_language",
"zerob.stdlibPath": "${workspaceFolder}/zerob_language/std",
"zerob.safeMode": true,
"zerob.includeStdlib": false
}
Installation & Reload
The extension is installed directly in ~/.vscode/extensions/zerob.vscode-zerob-0.7.3/.
To apply updates in VS Code:
- Open VS Code Command Palette:
Cmd + Shift + P
- Run:
Developer: Reload Window
Diagnostics configuration (2026-10-07)
Auto-detection selects the installed workspace zbc, including ancestor SDK
folders when a nested project is open. It never selects build/*/candidate-zbc.
--sdk-root resolves std.* and packages.* imports. This does not inject a
prelude into the document. Enable zerob.includeStdlib only for builds using
--std; an explicit zerob.stdlibPath also enables injection.
zerob.safeMode defaults to true. Set it to false in a workspace containing
trusted raw/NDK sources, matching that workspace's build. Configuration changes
restart the service. No error is suppressed: diagnostic codes and all four LSP
severity levels are preserved; outdated document versions are ignored.
The prior client forced safe mode, injected std into every file, omitted SDK
root, and preferred an experimental compiler. Real protocol probes reproduced
error 900 at line 1 for package imports without SDK root, and error 201 at line 1
for raw std/android.zb with injected std. With raw mode and no injection that
module has no diagnostics; a safe package import resolves with SDK root.
Project-aware LSP
Native compiler/driver/runtime files are grouped automatically using
zb_build source-registry. Application contexts use the native resolver:
{
"zerob.projects": [
{
"name": "app",
"documentRoot": "my-app",
"buildArguments": ["my-app/main.zb", "--safe", "--std"]
}
]
}
For pinned workspaces, replace buildArguments with
["--workspace", "workspace.zb", "--member", "app", "--safe"].
This calls zb_build editor-context without running the app. The native resolver
supplies root sources, SDK and private package mappings. Do not duplicate
--std injection in the project settings. Documents outside the discovered
closure can be covered by documentRoot; the server reports an informational
context message if they are still unrelated to the roots.
A manual context can instead specify sources, safeMode, includeStdlib,
sdkRoot, target, closedSources, rootCount, documents, packageModules,
packageScopes and packageDependencies. The profile must match the build;
there is no automatic permission to use raw pointers or FFI. Explicit projects
have priority over automatic native source groups. SDK std modules outside the
prelude use standalone namespace profiles: std/safe is safe with the safe prelude,
and the remaining SDK std implementation is raw without injected declarations.
This applies only inside the selected SDK, not to application files. The native application
projection currently accepts the installed Darwin profile. Manual LSP contexts
support registered targets for semantic checks, not execution certification.
Diagnostics point to dependency files, including closed files, and include the
initiating document as related information. Unsaved buffers are shared across
active contexts. Rapid edit snapshots coalesce for 180 ms; feature requests flush the newest
snapshots first. Saved-file/metadata changes refresh the service. Stale versions
and stopped-service responses are discarded; severities and codes are preserved.
Automatic std contexts use native --prelude-only projections: seven safe modules
and 24 raw modules. Batch startup avoids checking half-synchronized source unions.
The server admits 128 open documents and explicitly warns on snapshot limits.
Definition, symbols, hints and verified local rename account for each file's
position in the ordered source union. The server still reports the first error
per context and does not support a global workspace rename.
Run/Check/Compile save open files and use VS Code ProcessExecution tasks, without
shell interpolation. Native buildArguments are reused for those commands. Raw
runtime source groups require the native runtime-object workflow; a manual
package mapping requires the native pinned package/workspace build workflow.
The compiler must advertise zeroBBuildContext version 1. A native self-host
installation is required before enabling these contexts; an old compiler cannot
be made project-aware by hiding its diagnostics. Set zerob.nativeContexts to
false only when intentionally using an older standalone compiler.
What's New in 0.7.3 (2026-10-12)
Flexible Project Sources & Glob Patterns:
zerob.projects[].sources now accepts glob patterns like "kernel/exec/*.zb" as well as directory paths directly.
- Automatically resolves all matching
.zb files in alphabetical order.
Automatic Source Discovery from documentRoot:
- If
documentRoot is specified in a project context without an explicit sources list, all .zb files within documentRoot are automatically discovered and supplied as the compilation unit.
- Solves cross-file symbol resolution (
Unknown name) for bare-metal OS kernels, drivers, and multi-file subsystems without needing explicit import statements.
Universal Configuration & Marketplace Packaging:
- Sanitized configuration templates (using standard
${workspaceFolder}) for portable, privacy-preserving configuration across environments.
- Refreshed connection status reporting to v0.7.3.
- Retains strict duplicate-source verification while enabling seamless directory expansion.
Client regression commands:
node --test tests/protocol.test.js
node tests/project-context.test.js /absolute/path/to/zerob_language
node tests/lsp-client.test.js /absolute/path/to/zerob_language
node tests/native-context-client.test.js /absolute/path/to/zerob_language