reference

package
v0.36.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package reference is the annotation-reference popup: what the swagger: directive on this line means, and what may be written under it, without leaving the file to go and look it up.

It follows the same contract as the other overlays - a concrete type the root model owns and drives, never a tea.Model. Unlike them it records nothing: there is no answer to collect, only something to read and dismiss.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Overlay

type Overlay struct {
	// contains filtered or unexported fields
}

Overlay is the annotation-reference modal.

The zero value is a closed overlay; the root model opens it with Show.

func New

func New() Overlay

New builds a closed reference overlay.

func (*Overlay) Close

func (o *Overlay) Close()

Close hides the overlay.

func (*Overlay) HandleKey

func (o *Overlay) HandleKey(msg tea.KeyMsg) tea.Cmd

HandleKey dismisses the popup.

There is nothing to navigate - it is a few lines of reference text - so every key that plausibly means "done" closes it, including the key that opened it. Everything else is swallowed, as with the other overlays: acting on a key whose effect is hidden behind the modal is worse than ignoring it.

func (*Overlay) IsOpen

func (o *Overlay) IsOpen() bool

IsOpen reports whether the overlay is currently covering the UI.

func (*Overlay) SetSize

func (o *Overlay) SetSize(w, h int)

SetSize fits the overlay to outer dimensions w×h.

func (*Overlay) Show

func (o *Overlay) Show(name string, doc grammar.AnnotationDoc)

Show opens the popup on one annotation's entry.

func (*Overlay) View

func (o *Overlay) View() string

View renders the reference modal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL