util

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterStrings

func AfterStrings(value string, a string) string

AfterStrings gets the substring after a string.

func BetweenStrings

func BetweenStrings(value string, a string, b string) string

BetweenStrings gets the substring between two strings.

func ConcatMultipleSlices added in v0.0.4

func ConcatMultipleSlices[T any](slices [][]T) []T

func GetPositionOfNode added in v0.0.6

func GetPositionOfNode(node yamlv3.Node, query []string) (lsp.Position, error)

func PointToPosition added in v0.0.6

func PointToPosition(point sitter.Point) lsp.Position

func PositionToPoint added in v0.0.6

func PositionToPoint(position lsp.Position) sitter.Point

func URIToPath

func URIToPath(docuri uri.URI) (string, error)

func ValueAt added in v0.0.4

func ValueAt(str string, index int) string

ValueAt returns the value found at the given character position. It removes all content of the word after a "." right of the position.

func WordAt

func WordAt(str string, index int) string

WordAt returns the word found at the given character position. Credit https://github.com/aca/neuron-language-server/blob/450a7cff71c14e291ee85ff8a0614fa9d4dd5145/utils.go#L13

Types

type YamlPath added in v0.0.6

type YamlPath struct {
	TableNames []string
}

func NewYamlPath added in v0.0.6

func NewYamlPath(yamlPathString string) (YamlPath, error)

func (YamlPath) GetTail added in v0.0.6

func (path YamlPath) GetTail() []string

func (YamlPath) IsCapabilitiesPath added in v0.0.6

func (path YamlPath) IsCapabilitiesPath() bool

func (YamlPath) IsChartPath added in v0.0.6

func (path YamlPath) IsChartPath() bool

func (YamlPath) IsFilesPath added in v0.0.6

func (path YamlPath) IsFilesPath() bool

func (YamlPath) IsReleasePath added in v0.0.6

func (path YamlPath) IsReleasePath() bool

func (YamlPath) IsValuesPath added in v0.0.6

func (path YamlPath) IsValuesPath() bool

Jump to

Keyboard shortcuts

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