imenu

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package imenu finds the definitions in a file - its functions, types, classes, headings - for M-g i to jump to by name, as emacs's imenu does.

It reads lines, not code: each language has a few patterns for the lines that begin a definition, and a definition is a line that matches one. That is approximate at the edges and fast everywhere, which is the trade imenu has always made; it needs no parser, and it is right for the way code is actually laid out.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	// Name is what the definition is called, with what kind of thing it is
	// where that helps tell two apart: "func main", "type Buffer",
	// "(*Buffer) Insert".
	Name string
	// Line is where it is, from 0.
	Line int
}

Entry is one definition.

func For

func For(path string, lines []string) []Entry

For lists the definitions in a file at path whose text is lines, in order. A kind of file it has no rules for has none.

Jump to

Keyboard shortcuts

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