Skip to content

About

Nocterm is a Visual Studio Code extension that provides snippets for Nocterm

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Nocterm

Type-safe VS Code snippets for building Nocterm UI components in Dart.

CI Coverage Version TypeScript License

Features • Install • Usage • Snippet Reference • Development

Releases • VS Code Marketplace

Features

  • Focused snippets for common Nocterm component patterns.
  • Fast n-prefixed completions in Dart files.
  • nocterm_hooks support — useState, useEffect, useMemoized, and more with nh prefixes.
  • 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

From source (this repository)

  1. Install dependencies:

    npm install
  2. Compile the extension:

    npm run compile
  3. Press F5 in VS Code to launch an Extension Development Host.

Tip

The extension depends on the Dart extension: Dart-Code.dart-code.

Usage

Snippets

  1. Open a .dart file.
  2. Type one of the snippet prefixes (for example nstless).
  3. Select the snippet from IntelliSense.
  4. Fill in placeholders and tab through editable fields.

BLoC / Cubit Scaffolding

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.

Snippet Reference

Component Templates

Prefix Description
nstless Insert a StatelessComponent template
nstful Insert a StatefulComponent template
nstanim Insert a StatefulComponent with AnimationController

nocterm_hooks

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

Development

Scripts

npm run compile   # Build TypeScript
npm run watch     # Watch mode
npm run lint      # Lint source
npm test          # Run extension tests

Project Structure

  • snippets/nocterm.code-snippets: Snippet definitions and bodies.
  • src/extension.ts: Extension entrypoint.
  • src/test/: Extension test files.

Notes

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).

About

Nocterm is a Visual Studio Code extension that provides snippets for Nocterm

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages