Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Nix-js VS Code ToolkitNew to Visual Studio Code? Get it now.
Nix-js VS Code Toolkit

Nix-js VS Code Toolkit

DeijoseDevelop

|
2 installs
| (1) | Free
Syntax highlighting, html` template support, event completions (@click, @input), and snippets for Nix.js.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nix.js VS Code Toolkit

Editor tooling for Nix.js: syntax highlighting for html tagged templates, event binding autocomplete, and practical snippets for fast component authoring.

Features

  • HTML highlighting inside html tagged template literals
  • SVG highlighting inside svg tagged template literals
  • Event bindings highlighted as first-class attributes (@click, @input, @submit, ...)
  • Event modifier highlighting with dedicated scopes (@click.prevent.stop, @keydown.enter)
  • Template expressions (${...}) highlighted inside templates
  • Nested templates support (html inside ${...})
  • Autocomplete for common Nix event bindings and directive attributes inside html templates
  • Chained modifier autocomplete after . with key-aware suggestions for keyboard events
  • Diagnostics for invalid modifier combinations (for example .passive + .prevent) and unknown modifiers
  • Quick fixes for modifier diagnostics (remove duplicates, resolve passive/prevent conflict, replace unknown modifiers)
  • Hover help for modifiers (for example .prevent, .stop, .enter)
  • Configurable template tags for editor autocomplete (nixjs.tags)
  • TypeScript template language service integration via typescript-lit-html-plugin
  • Command to inspect active TextMate scopes in template code (Nix.js: Inspect Template Scopes)
  • Snippets for common Nix patterns (component, effect cleanup, computed, router, store)
  • Works in .ts, .tsx, .js, .jsx

Quick Example

function App() {
  const count = signal(0);

  return html`
    <p>Count: ${() => count.value}</p>
    <button @click=${() => count.value++}>+1</button>
  `;
}

Without the extension, the template is usually treated like a plain string. With the extension, tags, bindings, and expressions are colorized and contextual suggestions appear while typing attributes.

Snippets

Built-in snippet prefixes:

  • nix:component
  • nix:effect-cleanup
  • nix:computed
  • nix:router
  • nix:store

Settings

  • nixjs.tags (default: ['html', 'raw', 'svg'])
  • nixjs.completions.enableEventBindings (default: true)
  • nixjs.completions.enableModifierSuggestions (default: true)
  • nixjs.diagnostics.enable (default: true)
  • nixjs.diagnostics.enableStyleHints (default: true)

Commands

  • Nix.js: Inspect Template Scopes

Local Testing (Before Publishing)

From this extension folder:

npm install
npm test
npx vsce package

This generates a .vsix file. Install it locally:

code --install-extension vscode-nix-0.3.2.vsix --force

For this release branch, prefer installing the latest local package (currently vscode-nix-0.3.2.vsix).

Then reload VS Code and test in a .ts or .js file:

  1. Write an html template and verify highlighting.
  2. Write an svg template and verify XML-style highlighting.
  3. Type @ inside a tag and confirm event autocomplete appears.
  4. Type . after an event (for example @keydown.) and confirm modifier suggestions appear.
  5. Try an invalid combination like @wheel.passive.prevent=... and confirm diagnostics appear.
  6. Apply a quick fix on a modifier diagnostic.
  7. Hover a modifier (for example .prevent) and verify contextual help appears.
  8. Open snippets and type a prefix like nix:component.
  9. Run Nix.js: Inspect Template Scopes in a template line.

Manual smoke checklist is tracked in tests/SMOKE_TESTS.md and targets the real docs entry file ../nix-js-docs/src/main.ts.

Troubleshooting: Other Template Extensions

If highlighting still looks broken, disable or uninstall other extensions that also inject grammar into html tagged templates (for example bierner.lit-html). Two template injectors active at the same time can conflict and produce broken colors.

Publish to Marketplace

npm run publish:marketplace

Make sure your publisher is authenticated first:

npx vsce login deijose

Road To 1.0.0

Execution checklist and Definition of Done:

  • RELEASE_1_0_0_CHECKLIST.md

Links

  • npm: www.npmjs.com/package/@deijose/nix-js
  • GitHub: github.com/DeijoseDevelop/nix-js
  • Website: nix-js.dev

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft