Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Completion ¶
type Completion struct { Types []Type `json:"types"` Root []*Property `json:"root"` RootNoSession []*Property `json:"root_no_session"` }
Completion generates auto-complete paths
func NewCompletion ¶
func NewCompletion(types []Type, root []*Property) *Completion
NewCompletion creates a new empty completion
func (*Completion) EnumerateNodes ¶
func (c *Completion) EnumerateNodes(context *Context) []Node
EnumerateNodes walks the context to enumerate all possible nodes
func (*Completion) Validate ¶
func (c *Completion) Validate() error
Validate checks that all type references are valid
type Context ¶
Context is the runtime information required to generate completions
func NewContext ¶
NewContext creates a new completion context
type Property ¶
type Property struct { Key string `json:"key"` Help string `json:"help"` Type string `json:"type"` Array bool `json:"array,omitempty"` }
Property is a field of a context type which can be accessed in the context with the dot operator
func NewArrayProperty ¶
NewArrayProperty creates a new array property
func NewProperty ¶
NewProperty creates a new property
func ParseProperty ¶
ParseProperty parses a property from a docstring line
type Type ¶
type Type interface { Name() string TypeRefs() []string EnumerateProperties(context *Context) []*Property }
Type is a type that exists in the context
func NewDynamicType ¶
NewDynamicType creates a new dynamic type, i.e. properties determined at runtime
func NewStaticType ¶
NewStaticType creates a new static type