Skip to main content

Module annotations

Module annotations 

Source
Expand description

Annotation navigation and resolution editing.

This module provides editor-oriented utilities for working with annotations:

  • Navigation: Jump between annotations in document order with circular wrapping. Useful for implementing “next annotation” / “previous annotation” commands.

  • Resolution: Toggle the status=resolved parameter on annotations, enabling review workflows where annotations mark items needing attention.

All functions are stateless and operate on the parsed document AST. They return enough information for editors to apply changes (ranges, text edits) without needing to understand the Lex format internals.

Structs§

AnnotationEdit
A text edit that modifies an annotation’s header.
AnnotationNavigationResult
Result of navigating to an annotation.

Enums§

AnnotationDirection
Direction for annotation navigation.

Functions§

navigate
Navigates to an annotation in the specified direction.
next_annotation
Finds the next annotation after the current position, wrapping to the first if needed.
previous_annotation
Finds the previous annotation before the current position, wrapping to the last if needed.
resolution_edit
Computes the edit needed to change an annotation’s resolution status.
toggle_annotation_resolution
Toggles the resolution status of the annotation at the given position.