Type-safe VS Code snippets for building Nocterm UI components in Dart.
Features • Install • Usage • Snippet Reference • Development
Releases • VS Code Marketplace
- Focused snippets for common Nocterm component patterns.
- Fast
n-prefixed completions in Dart files. - nocterm_hooks support —
useState,useEffect,useMemoized, and more withnhprefixes. - Right-click BLoC/Cubit scaffolding — generate BLoC (3 files) or Cubit (2 files) from the VS Code explorer context menu.
Note
The coverage badge is marked as pending until coverage reporting is wired into CI.
-
Install dependencies:
npm install
-
Compile the extension:
npm run compile
-
Press
F5in VS Code to launch an Extension Development Host.
Tip
The extension depends on the Dart extension: Dart-Code.dart-code.
- Open a
.dartfile. - Type one of the snippet prefixes (for example
nstless). - Select the snippet from IntelliSense.
- Fill in placeholders and tab through editable fields.
Right-click a folder in the VS Code explorer and select Nocterm: New BLoC or Nocterm: New Cubit. Enter a name (e.g. counter) and the extension generates the file set with part directives:
| Command | Files Generated |
|---|---|
Nocterm: New BLoC |
{name}_bloc.dart, {name}_event.dart, {name}_state.dart |
Nocterm: New Cubit |
{name}_cubit.dart, {name}_state.dart |
The generated code uses nocterm_bloc conventions with sealed state classes and part-based file splitting.
| Prefix | Description |
|---|---|
nstless |
Insert a StatelessComponent template |
nstful |
Insert a StatefulComponent template |
nstanim |
Insert a StatefulComponent with AnimationController |
requires nocterm_hooks
| Prefix | Hook | Description |
|---|---|---|
nhook |
— | Full HookComponent template with imports, useState, useEffect, useMemoized |
nhusestate |
useState<T> |
Reactive ValueNotifier<T> — read .value, set to rebuild |
nhuseeffect |
useEffect |
Side effect with optional [keys] and cleanup return |
nhusememoized |
useMemoized<T> |
Cached value, recomputed only when keys change |
nhuseref |
useRef<T> |
Mutable reference surviving rebuilds without triggering them |
nhuseismounted |
useIsMounted() |
Guard for async continuations after await |
nhusecallback |
useCallback<T> |
Memoized function reference, stable across builds |
nhuselistenable |
useListenable<L> |
Subscribe to any Listenable/ChangeNotifier |
nhusevaluelistenable |
useValueListenable<T> |
Subscribe + return current .value in one call |
npm run compile # Build TypeScript
npm run watch # Watch mode
npm run lint # Lint source
npm test # Run extension testssnippets/nocterm.code-snippets: Snippet definitions and bodies.src/extension.ts: Extension entrypoint.src/test/: Extension test files.
Note
Snippets are triggered via n-prefixed completions in Dart files. BLoC/Cubit scaffolding is available through the explorer context menu or Command Palette (Nocterm: New BLoC, Nocterm: New Cubit).