gotools/gopls/internal/template/parse.go

var Left

var Right

type Parsed

type Token

type All

// New returns the Parses of the snapshot's tmpl files
// (maybe cache these, but then avoiding import cycles needs code rearrangements)
func New(tmpls map[protocol.DocumentURI]file.Handle) *All {}

func parseBuffer(buf []byte) *Parsed {}

// FindLiteralBefore locates the first preceding string literal
// returning its position and length in buf
// or returns -1 if there is none.
// Assume double-quoted string rather than backquoted string for now.
func (p *Parsed) FindLiteralBefore(pos int) (int, int) {}

var parseErrR

func (p *Parsed) setTokens() {}

func (p *Parsed) elideAt(left int) {}

// isEscaped reports whether the byte after buf is escaped
func isEscaped(buf []byte) bool {}

func (p *Parsed) Tokens() []Token {}

func (p *Parsed) utf16len(buf []byte) int {}

func (p *Parsed) TokenSize(t Token) (int, error) {}

// RuneCount counts runes in line l, from col s to e
// (e==0 for end of line. called only for multiline tokens)
func (p *Parsed) RuneCount(l, s, e uint32) uint32 {}

// LineCol converts from a 0-based byte offset to 0-based line, col. col in runes
func (p *Parsed) LineCol(x int) (uint32, uint32) {}

// Position produces a protocol.Position from an offset in the template
func (p *Parsed) Position(pos int) protocol.Position {}

func (p *Parsed) Range(x, length int) protocol.Range {}

// FromPosition translates a protocol.Position into an offset into the template
func (p *Parsed) FromPosition(x protocol.Position) int {}

func symAtPosition(fh file.Handle, loc protocol.Position) (*symbol, *Parsed, error) {}

func (p *Parsed) SymsAtPos(pos int) []symbol {}

type wrNode

// WriteNode is for debugging
func (p *Parsed) WriteNode(w io.Writer, n parse.Node) {}

func (wr wrNode) writeNode(n parse.Node, indent string) {}

var kindNames

func kindStr(k protocol.SymbolKind) string {}