snippet

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snippet

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

Snippet holds the parsed data structure of the snippet format defined in LSP protocol:

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#snippet_syntax

Usually this is used along with auto-completion.

func NewSnippet

func NewSnippet(content string) *Snippet

func (*Snippet) Parse

func (s *Snippet) Parse() error

func (*Snippet) Raw

func (s *Snippet) Raw() string

func (*Snippet) TabStopAt

func (s *Snippet) TabStopAt(idx int) *TabStop

func (*Snippet) TabStopOff

func (s *Snippet) TabStopOff(idx int) (int, int)

func (*Snippet) TabStopSize

func (s *Snippet) TabStopSize() int

func (*Snippet) TabStops

func (s *Snippet) TabStops() []*TabStop

func (*Snippet) Template

func (s *Snippet) Template() string

type TabStop

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

TabStop is the tabstop defined in LSP protocol:

func (TabStop) IsFinal

func (ts TabStop) IsFinal() bool

func (TabStop) String

func (sc TabStop) String() string

Jump to

Keyboard shortcuts

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