Documentation
¶
Overview ¶
Package source defines where code is: the language of a file, its path, and the positions and ranges in its bytes.
Coordinates ¶
Offsets, lines and columns are zero-based byte counts. Position.Offset is authoritative. Position.Line and Position.Column are derived from it, so an answer is readable without the file. An engine whose protocol counts UTF-16 code units converts them to bytes before it returns a position.
Paths ¶
A Path is slash-separated and relative to the workspace root on every platform. No port accepts or returns an absolute path.
Ranges ¶
A Span is half-open: it includes Start and excludes End.
Dependency position ¶
It does not import any package. The packages sema, trust, diag, edit and engine of core import it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Language ¶
type Language string
Language identifies a programming language on requests and answers. The zero value is the empty string, which is not a language.
Each language module declares its own value, and core declares none. The language registry refuses a value that two modules declare. The value is part of every go.dokimi.dev/techne/core/sema.ID, so changing it invalidates the IDs an index has stored.
type Path ¶
type Path string
Path is a slash-separated file path, relative to the workspace root. The zero value is the empty string, which is not a path.
type Position ¶
type Position struct {
// Offset is the zero-based byte offset. It is authoritative.
Offset int `json:"offset"`
// Line is the zero-based line of Offset.
Line int `json:"line"`
// Column is the zero-based byte column of Offset.
Column int `json:"column"`
}
Position is one point in a file. The zero value is the first byte.