compile

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package compile reads the output of a build or a test run the way emacs's compilation mode does: it cleans what a program printed for a terminal into plain lines, and finds the lines that point at a place in a file - an error, a warning, a failing test - so the editor can take you there.

It knows nothing of buffers or processes. The editor runs the command and feeds each line through here, and decides for itself which of the files a line names exist.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(line string) string

Clean turns one line of a program's output into plain text: escape sequences go, and a carriage return starts the line over, as it would on a terminal - a progress bar that redraws itself leaves only where it got to. Other control characters, which would only show as noise, are dropped, but a tab stays.

Types

type Kind

type Kind int

Kind is how serious a located line is.

const (
	Error Kind = iota
	Warning
	Info
)

type Loc

type Loc struct {
	// File is the path as the line gives it: relative to wherever the
	// command ran, as often as not.
	File string
	// Line and Col count from 1, as compilers do. Col is 0 when the line
	// gives none.
	Line, Col int
	Kind      Kind
	// Start and End are the rune range of the line that names the place,
	// for the editor to colour.
	Start, End int
}

Loc is a place in a file that a line of output points at.

func Parse

func Parse(line string) (Loc, bool)

Parse finds the place in a file line points at, and false if it points at none.

Jump to

Keyboard shortcuts

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