Versions in this module Expand all Collapse all v1 v1.0.3 Dec 13, 2020 v1.0.2 Dec 13, 2020 Changes in this version + var Invalid = Span + func Compare(a, b Span) int + func ComparePoint(a, b Point) int + func CompareURI(a, b URI) int + func ToUTF16Column(p Point, content []byte) (int, error) + type Converter interface + ToOffset func(line, col int) (int, error) + ToPosition func(offset int) (int, int, error) + type FileConverter struct + func (l *FileConverter) ToOffset(line, col int) (int, error) + func (l *FileConverter) ToPosition(offset int) (int, int, error) + type Point struct + func FromUTF16Column(p Point, chr int, content []byte) (Point, error) + func NewPoint(line, col, offset int) Point + func (p *Point) MarshalJSON() ([]byte, error) + func (p *Point) UnmarshalJSON(b []byte) error + func (p Point) Column() int + func (p Point) HasOffset() bool + func (p Point) HasPosition() bool + func (p Point) IsValid() bool + func (p Point) Line() int + func (p Point) Offset() int + type Range struct + Converter Converter + End token.Pos + FileSet *token.FileSet + Start token.Pos + func NewRange(fset *token.FileSet, start, end token.Pos) Range + func (r Range) IsPoint() bool + func (r Range) Span() (Span, error) + type Span struct + func FileSpan(tok *token.File, converter Converter, start, end token.Pos) (Span, error) + func New(uri URI, start Point, end Point) Span + func Parse(input string) Span + func (s *Span) MarshalJSON() ([]byte, error) + func (s *Span) UnmarshalJSON(b []byte) error + func (s Span) End() Point + func (s Span) Format(f fmt.State, c rune) + func (s Span) HasOffset() bool + func (s Span) HasPosition() bool + func (s Span) IsPoint() bool + func (s Span) IsValid() bool + func (s Span) Range(converter *TokenConverter) (Range, error) + func (s Span) Start() Point + func (s Span) URI() URI + func (s Span) WithAll(c Converter) (Span, error) + func (s Span) WithOffset(c Converter) (Span, error) + func (s Span) WithPosition(c Converter) (Span, error) + type TokenConverter struct + func NewContentConverter(filename string, content []byte) *TokenConverter + func NewTokenConverter(fset *token.FileSet, f *token.File) *TokenConverter + type URI string + func URIFromPath(path string) URI + func URIFromURI(s string) URI + func (uri URI) Filename() string + func (uri URI) IsFile() bool