source

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuiltinDetail = `built-in function

See https://www.openpolicyagent.org/docs/latest/policy-reference/#built-in-functions`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletionItem

type CompletionItem struct {
	Label               string
	Kind                CompletionKind
	Detail              string
	TextEdit            *TextEdit
	AdditionalTextEdits []TextEdit
}

type CompletionKind

type CompletionKind int
const (
	Unknown CompletionKind = iota
	VariableItem
	PackageItem
	FunctionItem
	BuiltinFunctionItem
	ImportItem
)

type Document

type Document struct {
	Content  string
	Language string
}

type File

type File struct {
	RawText string
	Version int
}

type LookUpResult

type LookUpResult struct {
	Location *ast.Location
}

type Project

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

func NewProject

func NewProject(rootPath string) (*Project, error)

func NewProjectWithFiles

func NewProjectWithFiles(files map[string]File) (*Project, error)

func (*Project) DeleteFile

func (p *Project) DeleteFile(path string)

func (*Project) GetErrors

func (p *Project) GetErrors(path string) map[string]ast.Errors

func (*Project) GetFile

func (p *Project) GetFile(path string) (string, bool)

func (*Project) GetModule

func (p *Project) GetModule(path string) *ast.Module

func (*Project) GetRawText

func (p *Project) GetRawText(path string) (string, error)

func (*Project) ListCompletionItems

func (p *Project) ListCompletionItems(location *ast.Location) ([]CompletionItem, error)

func (*Project) LookupDefinition

func (p *Project) LookupDefinition(location *ast.Location) ([]*ast.Location, error)

func (*Project) LookupReferences

func (p *Project) LookupReferences(loc *ast.Location) ([]*ast.Location, error)

func (*Project) SearchTargetTerm

func (p *Project) SearchTargetTerm(location *ast.Location) (term *ast.Term, err error)

func (*Project) TermDocument

func (p *Project) TermDocument(loc *ast.Location) ([]Document, error)

func (*Project) UpdateFile

func (p *Project) UpdateFile(path string, text string, version int) error

type TextEdit

type TextEdit struct {
	Row  int
	Col  int
	Text string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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