providers

package
v0.29.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltIns

type BuiltIns struct{}

func (*BuiltIns) Name added in v0.24.0

func (*BuiltIns) Name() string

func (*BuiltIns) Run

type Input added in v0.23.0

type Input struct{}

Input is a simple completion provider that returns the input keyword as a completion item at suitable times.

func (*Input) Name added in v0.24.0

func (*Input) Name() string

func (*Input) Run added in v0.23.0

type Options

type Options struct {
	// Builtins is a map of built-in functions to their definitions required in
	// the context of the current completion request.
	Builtins         map[string]*ast.Builtin
	RootURI          string
	ClientIdentifier clients.Identifier
}

type PackageRefs added in v0.23.0

type PackageRefs struct{}

PackageRefs is a completion provider that returns completions when importing packages.

func (*PackageRefs) Name added in v0.24.0

func (*PackageRefs) Name() string

func (*PackageRefs) Run added in v0.23.0

type Policy added in v0.24.0

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

Policy provides suggestions that have been determined by Rego policy.

func NewPolicy added in v0.24.0

func NewPolicy(ctx context.Context, store storage.Store) *Policy

NewPolicy creates a new Policy provider. This provider is distinctly different from the other providers as it acts like the entrypoint for all Rego-based providers, and not a single provider "function" like the Go providers do.

func (*Policy) Name added in v0.24.0

func (*Policy) Name() string

func (*Policy) Run added in v0.24.0

func (p *Policy) Run(
	ctx context.Context,
	c *cache.Cache,
	params types.CompletionParams,
	opts *Options,
) ([]types.CompletionItem, error)

type RuleHead added in v0.23.0

type RuleHead struct{}

RuleHead is a completion provider that returns completions for rules found in the same package at the start of a line, so when adding new heads, the user can easily add new ones.

func (*RuleHead) Name added in v0.24.0

func (*RuleHead) Name() string

func (*RuleHead) Run added in v0.23.0

type RuleHeadKeyword added in v0.23.0

type RuleHeadKeyword struct{}

RuleHeadKeyword will return completions for the keywords when starting a new rule. The current cases are supported: - [rule-name] if - [rule-name] := - [rule-name] contains - [rule-name] contains if These completions are mandatory, that means they are the only ones to be shown.

func (*RuleHeadKeyword) Name added in v0.24.0

func (*RuleHeadKeyword) Name() string

func (*RuleHeadKeyword) Run added in v0.23.0

Jump to

Keyboard shortcuts

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