ctags

package
v0.0.0-...-6339fb7 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

A Reader reads ctags entries.

func NewReader

func NewReader(r io.Reader) *Reader

NewReader returns a new Reader that reads from r.

func (*Reader) Read

func (r *Reader) Read() (tl TagLine, err error)

Read reads one entry from r. If there is no data left to be read, Read returns an empty TagLine and io.EOF.

func (*Reader) ReadAll

func (r *Reader) ReadAll() []TagLine

ReadAll reads all the remaining entries from r.

type TagFields

type TagFields map[string]string

TagFields is a map of name/value pairs.

type TagLine

type TagLine struct {
	// Any identifier, not containing white space.
	TagName string

	// The name of the file where {tagname} is defined, relative to the current
	// directory.
	TagFile string

	// Any Ex command. When executed, it behaves like 'magic' was not set. It may
	// be restricted to a line number or a search pattern (Posix).
	TagAddress string

	// A tagfield is a key, value pair.
	TagFields TagFields
}

TagLine represents a single ctags match.

func (TagLine) Kind

func (tl TagLine) Kind() string

Kind is the kind of tag this is. If no "kind" tagfield exists, this returns an empty string.

func (TagLine) Line

func (tl TagLine) Line() int

Line is the line on which this tag was found. If the line can't be determined, -1 is returned.

func (TagLine) String

func (tl TagLine) String() string

String implements Stringer.String() from the strings package.

type Writer

type Writer struct {
	*bufio.Writer
}

A Writer writes ctags entries.

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter returns a new Writer that writes to w.

func (Writer) Write

func (w Writer) Write(tl TagLine) error

Write writes a single ctags entry to w. Writes are buffered, so Flush must eventually be called to ensure that the record is written to the underlying io.Writer.

func (Writer) WriteAll

func (w Writer) WriteAll(lines []TagLine) (err error)

WriteAll writes multiple ctags entries to w using Write and then calls Flush, returning any error from the Flush.

Jump to

Keyboard shortcuts

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