Documentation
¶
Index ¶
- func CreatePositionMap(tree *schema.TreeNode) map[string][]*schema.TreeNode
- func DetermineDocFormat(docURI lsp.URI) schema.SpecFormat
- func LoadProviders(ctx context.Context) (map[string]provider.Provider, error)
- func LoadTransformers(ctx context.Context) (map[string]transform.SpecTransformer, error)
- func ParseJWCCNode(content string) (*json.Node, error)
- func ParseYAMLNode(content string) (*yaml.Node, error)
- func PositionKey(pos *source.Position) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePositionMap ¶
CreatePositionMap creates a map of positions to tree nodes for a given tree. This allows for efficient lookup of elements in a blueprint based on their starting location.
This produces a list of tree nodes for each start position key, with the element with the smallest range being the last element in the list (Due to order of traversal).
This uses the `PositionKey` function to encode the start position as a string key. Positions are expected to be 1-indexed, further conversion is needed to produce 0-indexed positions compatible with the LSP.
func DetermineDocFormat ¶
func DetermineDocFormat(docURI lsp.URI) schema.SpecFormat
DetermineDocFormat determines the document format based on the file extension.
func LoadProviders ¶
LoadProviders deals with loading initial providers to be used for validating and in providing other LSP features for blueprint such as function signatures, hover information and completion items.
The language server uses the deploy engine plugin system to load gRPC provider plugins at a later stage.
func LoadTransformers ¶
LoadTransformers deals with loading initial transformers to be used for validating and in providing other LSP features for blueprint such as hover information.
The language server uses the deploy engine plugin system to load gRPC transformer plugins at a later stage.
func ParseJWCCNode ¶
ParseJWCCNode parses the given JSON with Commas and Comments content and returns the root node of the JSON document hierarchy that can be used for things like extracting document symbols.
func ParseYAMLNode ¶
ParseYAMLNode parses the given YAML content and returns the root node of the YAML document hierarchy that can be used for things like extracting document symbols.
func PositionKey ¶
PositionKey encodes a position as a string key. This produces a key of the form `line:column`. If the provided source meta struct is nil, `1:1` is returned.
Types ¶
This section is empty.