Skip to main content

Module plugin

Module plugin 

Source
Expand description

The LanguagePlugin trait + Options + Preset.

A plugin turns a workspace into nodes + edges at a requested level (analyze) and writes the per-file complexity metrics for its own language onto those nodes (metrics). Metrics are a per-language concern — each plugin parses its own files with its own grammar and calls the matching code-ranker-complexity engine — so there is no central, by-extension metric dispatcher. The language-agnostic derived data (cycles, Henry-Kafura, stats) is still filled centrally by the orchestrator. The CLI holds the registry of plugins; it talks to them ONLY through this trait and never names a concrete language.

Structs§

PluginInput
Everything the orchestrator feeds a plugin from config + CLI input.
Preset
A Prompt-Generator preset (a refactoring principle): a ready-to-paste AI instruction plus how the UI seeds the node selection for it. The orchestrator builds a generic default set and hands it to LanguagePlugin::presets, which may pass it through, edit, drop or extend per language.

Traits§

LanguagePlugin

Functions§

detect_with_marker
Return true when workspace contains the given marker file. A generic, language-agnostic detection helper for marker-based plugins (e.g. JS → "package.json", TS → "tsconfig.json"). Lives here, not in any one language plugin, so every plugin can reuse it without depending on a sibling plugin.

Type Aliases§

Options
Free-form key/value options passed from the CLI (future --plugin-opt k=v). BTreeMap for deterministic iteration order.