tekton

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	IdentKindParam identifierKind = iota
	IdentKindResult
	IdentKindWorkspace
	IdentKindPipelineTask
	IdentKindTask
)

Variables

This section is empty.

Functions

func IdentParameter

func IdentParameter(v StringMap, parent interface{}) *identParam

Types

type CompletionCandidate

type CompletionCandidate struct {
	// Text is the completion to be suggested.
	Text string

	// Value is the Tekton object to which the completion refers.
	Value Meta
}

CompletionCandidate holds the text of a completion and the Tekton object to which it refers.

func (CompletionCandidate) String

func (c CompletionCandidate) String() string

String implements fmt.Stringer for CompletionCandidate.

type Document

type Document struct {
	// TextDocument is the LSP TextDocument which contains this document.
	file.TextDocument
	// contains filtered or unexported fields
}

Document provides operation on a single YAML document containing a Tekton resource.

type File

type File struct {
	// TextDocument of this file.
	file.TextDocument
	// contains filtered or unexported fields
}

File provides operation on a YAML file containing any number of Tekton Documents - separated by `---` as defined by the YAML spec.

func NewFile

func NewFile(f file.TextDocument) *File

NewFile sanitizes a TextDocument, parses its YAML contents into an AST, and calculates the offset and size of every YAML document in the file.

func (*File) Completions

func (f *File) Completions(pos protocol.Position) []fmt.Stringer

Completions returns a list of completion suggestions for the given position.

func (*File) Definition

func (f *File) Definition(pos protocol.Position) *protocol.Location

Definition returns the Location where the identifier in the given position is defined, or nil if no identifier is found.

func (*File) Diagnostics

func (f *File) Diagnostics() []protocol.Diagnostic

Diagnostics returns a list of Diagnostics issues found in this File.

func (*File) FindReferences

func (f *File) FindReferences(pos protocol.Position) []protocol.Location

FindReferences returns a list of all Locations which refer to the identifier in the given position, or nil if no identifier is found.

func (*File) Hover

func (f *File) Hover(pos protocol.Position) *string

Hover returns a pointer to a string containing the Documentation of the Tekton object in the given position, or nil if no reference is found.

func (*File) PrepareRename

func (f *File) PrepareRename(pos protocol.Position) *protocol.Location

PrepareRename returns the Location (File, Range) that should be edited if a Rename request is made at the given position. It should return nil if it's not a valid position for a rename request, that is, if no identifier is found at the given position.

func (*File) Rename

func (f *File) Rename(pos protocol.Position, newName string) (*protocol.WorkspaceEdit, error)

Rename returns the Workspace changes required to rename the identifier in the given position to the newName argument.

type IdentResult

type IdentResult StringMap

func (IdentResult) Completions

func (p IdentResult) Completions() []completion

func (IdentResult) Description

func (p IdentResult) Description() string

func (IdentResult) Documentation

func (p IdentResult) Documentation() string

func (IdentResult) Name

func (p IdentResult) Name() string

type IdentTask

type IdentTask StringMap

func (IdentTask) Completions

func (p IdentTask) Completions() []completion

func (IdentTask) Documentation

func (p IdentTask) Documentation() string

func (IdentTask) Name

func (p IdentTask) Name() string

type IdentWorkspace

type IdentWorkspace StringMap

func (IdentWorkspace) Completions

func (p IdentWorkspace) Completions() []completion

func (IdentWorkspace) Description

func (p IdentWorkspace) Description() string

func (IdentWorkspace) Documentation

func (p IdentWorkspace) Documentation() string

func (IdentWorkspace) Name

func (p IdentWorkspace) Name() string

type Meta

type Meta interface {
	// Name returns the name of the given Tekton object.
	Name() string

	// Documentation returns the Markdown documentation of the given Tekton
	// object.
	Documentation() string

	// Completions returns a list of possible completion suggestions
	// associated with the Tekton object.
	Completions() []completion
}

Meta is the root interface for any given Tekton object understood by this language server.

type PipelineTask

type PipelineTask StringMap

func (PipelineTask) Completions

func (p PipelineTask) Completions() []completion

func (PipelineTask) Documentation

func (p PipelineTask) Documentation() string

func (PipelineTask) Name

func (p PipelineTask) Name() string

type StringMap

type StringMap = map[string]interface{}

type Workspace

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

func NewWorkspace

func NewWorkspace() *Workspace

func (*Workspace) AddFolder

func (w *Workspace) AddFolder(uri string)

func (*Workspace) Diagnostics

func (w *Workspace) Diagnostics(cb func(protocol.PublishDiagnosticsParams))

func (*Workspace) File

func (w *Workspace) File(uri string) *File

func (*Workspace) FindReferences

func (w *Workspace) FindReferences(docUri string, pos protocol.Position) []protocol.Location

func (*Workspace) Lint

func (w *Workspace) Lint()

func (*Workspace) Rename

func (w *Workspace) Rename(docUri string, pos protocol.Position, newName string) (*protocol.WorkspaceEdit, error)

func (*Workspace) UpsertFile

func (w *Workspace) UpsertFile(uri string, text string)

Jump to

Keyboard shortcuts

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