completions

package
v0.378.1-next.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindModel       = "model"
	KindAction      = "action"
	KindField       = "field"
	KindVariable    = "variable"
	KindType        = "type"
	KindKeyword     = "keyword"
	KindLabel       = "label"
	KindAttribute   = "attribute"
	KindPunctuation = "punctuation"
	KindInput       = "inputs"
)
View Source
const (
	DescriptionSuggested = "Suggested"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletionItem

type CompletionItem struct {
	Label       string `json:"label"`
	Description string `json:"description"`
	Kind        string `json:"kind"`

	// If empty use `Label`
	InsertText string `json:"insertText"`
}

func Completions

func Completions(schemaFiles []*reader.SchemaFile, pos *node.Position, cfg *config.ProjectConfig) []*CompletionItem

type Token

type Token struct {
	Value string
	Pos   *node.Position
}

Token represents a single token e.g. "@" or "model"

type TokensAtPosition

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

TokensAtPosition represents a list of tokens with a current position The position should be considered immutable for each TokensAtPosition instance.

func NewTokensAtPosition

func NewTokensAtPosition(schema string, pos *node.Position) *TokensAtPosition

func (*TokensAtPosition) EndOfBlock

func (t *TokensAtPosition) EndOfBlock() *TokensAtPosition

func (*TokensAtPosition) EndOfGroup

func (t *TokensAtPosition) EndOfGroup(start string, end string) *TokensAtPosition

func (*TokensAtPosition) EndOfParen

func (t *TokensAtPosition) EndOfParen() *TokensAtPosition

func (*TokensAtPosition) FindPrev

func (t *TokensAtPosition) FindPrev(value string) *TokensAtPosition

func (*TokensAtPosition) FindPrevMultiple

func (t *TokensAtPosition) FindPrevMultiple(values ...string) (string, *TokensAtPosition)

func (*TokensAtPosition) FindPrevMultipleOnLine

func (t *TokensAtPosition) FindPrevMultipleOnLine(values ...string) (string, *TokensAtPosition)

func (*TokensAtPosition) FindPrevOnLine

func (t *TokensAtPosition) FindPrevOnLine(value string) *TokensAtPosition

* * Find a previous token with a given value on the same line as the current token *

func (*TokensAtPosition) FindPrevOnLineAt

func (t *TokensAtPosition) FindPrevOnLineAt(value string, offset int) *TokensAtPosition

* * Find a previous token with a given value on the same line the given offset *

func (*TokensAtPosition) Is

func (t *TokensAtPosition) Is(others ...*TokensAtPosition) bool

func (*TokensAtPosition) IsNewLine

func (t *TokensAtPosition) IsNewLine() bool

* * Returns true of the current token is at the beginning of a new line *

func (*TokensAtPosition) Line

func (t *TokensAtPosition) Line() int

func (*TokensAtPosition) LineAt

func (t *TokensAtPosition) LineAt(offset int) int

func (*TokensAtPosition) Next

func (*TokensAtPosition) Prev

func (*TokensAtPosition) Start

func (t *TokensAtPosition) Start() *TokensAtPosition

func (*TokensAtPosition) StartOfBlock

func (t *TokensAtPosition) StartOfBlock() *TokensAtPosition

func (*TokensAtPosition) StartOfGroup

func (t *TokensAtPosition) StartOfGroup(start string, end string) *TokensAtPosition

func (*TokensAtPosition) StartOfParen

func (t *TokensAtPosition) StartOfParen() *TokensAtPosition

func (*TokensAtPosition) Value

func (t *TokensAtPosition) Value() string

func (*TokensAtPosition) ValueAt

func (t *TokensAtPosition) ValueAt(offset int) string

Jump to

Keyboard shortcuts

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