language

package
v0.0.0-...-60b86bc Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLanguageNotFound = errors.New("language not found")
)

Functions

This section is empty.

Types

type File

type File interface {
	Hover(point location.Point) *hover.Hover
	Replace(text string, r *location.Range)
	Problems() *problems.Problems
	Uri() uri.DocumentURI
	Path() string
	Reset(s string)
	Semantics() *semantic.Semantics
	CodeActions(r *location.Range) ([]protocol.CodeAction, error)
}

type Language

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

func (*Language) CreateFile

func (l *Language) CreateFile(u uri.DocumentURI, r io.Reader) (File, error)

func (*Language) DeleteUri

func (l *Language) DeleteUri(u uri.DocumentURI)

func (*Language) GetFromUri

func (l *Language) GetFromUri(u uri.DocumentURI) File

func (*Language) On

func (l *Language) On() *LanguageOn

type LanguageDef

type LanguageDef interface {
	Init(functions *LanguageFunctions)
	Parse(uri uri.DocumentURI, r io.Reader) (File, error)
	ID() string
	Commands() []commands.Command
	Completions() completion.Completions
	On() *LanguageOn
}

LanguageDef is the interface that a language must implement to be supported by glsp.

type LanguageFunctions

type LanguageFunctions struct {
	GetFile   func(uri uri.DocumentURI) (*Language, File)
	GetSchema func(path string) string
	Notify    glsp.NotifyFunc
}

type LanguageOn

type LanguageOn struct {
	SaveFn func(f File) error
}

func (*LanguageOn) Save

func (l *LanguageOn) Save(f File) error

type Languages

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

func NewLanguages

func NewLanguages() *Languages

func (*Languages) AddLanguage

func (l *Languages) AddLanguage(lang LanguageDef)

func (*Languages) CommandProvider

func (l *Languages) CommandProvider() *protocol.ExecuteCommandOptions

func (*Languages) CommandsExecute

func (l *Languages) CommandsExecute(context *glsp.Context, params *protocol.ExecuteCommandParams) (any, error)

func (*Languages) CreateFile

func (l *Languages) CreateFile(u uri.DocumentURI, langID string, r io.Reader) (File, error)

func (*Languages) DeleteUri

func (l *Languages) DeleteUri(u uri.DocumentURI) error

func (*Languages) Get

func (l *Languages) Get(id string) *Language

func (*Languages) GetFromUri

func (l *Languages) GetFromUri(uri uri.DocumentURI) (*Language, File)

func (*Languages) GetSchema

func (l *Languages) GetSchema(path string) string

func (*Languages) Languages

func (l *Languages) Languages(yield func(LanguageDef) bool)

func (*Languages) SetConn

func (l *Languages) SetConn(conn *jsonrpc2.Conn)

Jump to

Keyboard shortcuts

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