Editor errors

Common error signatures

The editor feature raises errors across four areas: frontmatter parsing, lint diagnostics, reference lookup, and rename execution. The following exceptions are the most common failure modes.

SchemaError — raised by parse_frontmatter() when the frontmatter block cannot be parsed as YAML at all:

SchemaError: Malformed YAML in frontmatter: <detail>

ValueError — raised by find_references() or plan_rename() when the caller passes an unsupported ReferenceKind:

ValueError: Unsupported reference kind: <kind>
ValueError: Unsupported rename kind: <kind>

RenameCollisionError — a subclass of RenameError, raised by apply_rename() when the proposed new name already exists in the corpus. Carries the conflicting name and the owning_path of the file that owns it.

RenameError — the base class for all rename failures, raised by apply_rename() in several distinct states:

RenameError: Corpus has no resolvable root path; apply is not supported.
RenameError: Move source missing at apply time: <path>
RenameError: Failed to move <old> -> <new>: <detail>
RenameError: Planned target does not exist: <path>
RenameError: File <path> drifted from the planned base; rebuild plan.

How to diagnose

Frontmatter and schema errors

Reference and rename kind errors

Rename application errors

apply_rename() applies a RenamePlan to disk. It can fail at several points:

Lint diagnostics

lint_template() does not raise on lint failures — it returns a list of Diagnostic objects. If you expect diagnostics but receive an empty list, confirm that text is non-empty and that rel_path resolves correctly within the corpus. Each Diagnostic carries a severity, code, message, and 1-indexed line/col/end_line/end_col range.

Source files

Tags: editor, lint, rename, autocomplete, schema, references, refactor, template