types

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyWorkspaceEditParams

type ApplyWorkspaceEditParams struct {
	Label string        `json:"label"`
	Edit  WorkspaceEdit `json:"edit"`
}

type ApplyWorkspaceRenameEditParams added in v0.26.0

type ApplyWorkspaceRenameEditParams struct {
	Label string              `json:"label"`
	Edit  WorkspaceRenameEdit `json:"edit"`
}

type BuiltinPosition added in v0.22.0

type BuiltinPosition struct {
	Builtin *ast.Builtin
	Line    uint
	Start   uint
	End     uint
}

type Client

type Client struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type ClientCapabilities

type ClientCapabilities struct {
	General   GeneralClientCapabilities      `json:"general"`
	Text      TextDocumentClientCapabilities `json:"textDocument"`
	Workspace WorkspaceClientCapabilities    `json:"workspace"`
	Window    WindowClientCapabilities       `json:"window"`
}

type CodeAction

type CodeAction struct {
	Command     Command      `json:"command"`
	IsPreferred *bool        `json:"isPreferred,omitempty"`
	Title       string       `json:"title"`
	Kind        string       `json:"kind"`
	Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}

type CodeActionContext

type CodeActionContext struct {
	Diagnostics []Diagnostic `json:"diagnostics"`
}

type CodeActionOptions

type CodeActionOptions struct {
	CodeActionKinds []string `json:"codeActionKinds"`
}

type CodeActionParams

type CodeActionParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Context      CodeActionContext      `json:"context"`
	Range        Range                  `json:"range"`
}

type CodeDescription

type CodeDescription struct {
	Href string `json:"href"`
}

type CodeLens added in v0.25.0

type CodeLens struct {
	Command *Command `json:"command,omitempty"`
	Data    *any     `json:"data,omitempty"`
	Range   Range    `json:"range"`
}

type CodeLensOptions added in v0.25.0

type CodeLensOptions struct {
	ResolveProvider *bool `json:"resolveProvider,omitempty"`
}

type CodeLensParams added in v0.25.0

type CodeLensParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

type Command

type Command struct {
	Arguments *[]any `json:"arguments,omitempty"`
	Title     string `json:"title"`
	Tooltip   string `json:"tooltip"`
	Command   string `json:"command"`
}

type CompletionContext added in v0.22.0

type CompletionContext struct {
	TriggerCharacter string                 `json:"triggerCharacter"`
	TriggerKind      completion.TriggerKind `json:"triggerKind"`
}

type CompletionItem added in v0.22.0

type CompletionItem struct {
	LabelDetails    *CompletionItemLabelDetails `json:"labelDetails,omitempty"`
	Documentation   *MarkupContent              `json:"documentation,omitempty"`
	TextEdit        *TextEdit                   `json:"textEdit,omitempty"`
	InserTextFormat *uint                       `json:"insertTextFormat,omitempty"`

	// Regal is used to store regal-specific metadata about the completion item.
	// This is not part of the LSP spec, but used in the manager to post process
	// items before returning them to the client.
	Regal  *CompletionItemRegalMetadata `json:"_regal,omitempty"`
	Label  string                       `json:"label"`
	Detail string                       `json:"detail"`
	// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemKind
	Kind      completion.ItemKind `json:"kind"`
	Preselect bool                `json:"preselect"`

	// Mandatory is used to indicate that the completion item is mandatory and should be offered
	// as an exclusive completion. This is not part of the LSP spec, but used in regal providers
	// to indicate that the completion item is the only valid completion.
	Mandatory bool `json:"-"`
}

type CompletionItemLabelDetails added in v0.22.0

type CompletionItemLabelDetails struct {
	Description string `json:"description"`
	Detail      string `json:"detail"`
}

type CompletionItemOptions added in v0.22.0

type CompletionItemOptions struct {
	LabelDetailsSupport bool `json:"labelDetailsSupport"`
}

type CompletionItemRegalMetadata added in v0.24.0

type CompletionItemRegalMetadata struct {
	Provider string `json:"provider"`
}

type CompletionList added in v0.22.0

type CompletionList struct {
	Items        []CompletionItem `json:"items"`
	IsIncomplete bool             `json:"isIncomplete"`
}

type CompletionOptions added in v0.22.0

type CompletionOptions struct {
	CompletionItem  CompletionItemOptions `json:"completionItem"`
	ResolveProvider bool                  `json:"resolveProvider"`
}

type CompletionParams added in v0.22.0

type CompletionParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Context      CompletionContext      `json:"context"`
	Position     Position               `json:"position"`
}

type DefinitionParams

type DefinitionParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Position     Position               `json:"position"`
}

type DeleteFile added in v0.26.2

type DeleteFile struct {
	Options *DeleteFileOptions `json:"options,omitempty"`
	Kind    string             `json:"kind"` // must always be "delete"
	URI     string             `json:"uri"`
}

type DeleteFileOptions added in v0.26.2

type DeleteFileOptions struct {
	Recursive         bool `json:"recursive"`
	IgnoreIfNotExists bool `json:"ignoreIfNotExists"`
}

type Diagnostic

type Diagnostic struct {
	CodeDescription *CodeDescription `json:"codeDescription,omitempty"`
	Message         string           `json:"message"`
	Source          string           `json:"source"`
	Code            string           `json:"code"`
	Range           Range            `json:"range"`
	Severity        uint             `json:"severity"`
}

type DiagnosticClientCapabilities

type DiagnosticClientCapabilities struct {
	DynamicRegistration    bool `json:"dynamicRegistration"`
	RelatedDocumentSupport bool `json:"relatedDocumentSupport"`
}

type DiagnosticCode

type DiagnosticCode struct {
	Value  string `json:"value"`
	Target string `json:"target"`
}

type DiagnosticOptions

type DiagnosticOptions struct {
	Identifier            string `json:"identifier"`
	InterFileDependencies bool   `json:"interFileDependencies"`
	WorkspaceDiagnostics  bool   `json:"workspaceDiagnostics"`
}

type DiagnosticWorkspaceClientCapabilities

type DiagnosticWorkspaceClientCapabilities struct {
	RefreshSupport bool `json:"refreshSupport"`
}

type DocumentFormattingParams

type DocumentFormattingParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Options      FormattingOptions      `json:"options"`
}

type DocumentSymbol

type DocumentSymbol struct {
	Detail         *string            `json:"detail,omitempty"`
	Children       *[]DocumentSymbol  `json:"children,omitempty"`
	Name           string             `json:"name"`
	Range          Range              `json:"range"`
	SelectionRange Range              `json:"selectionRange"`
	Kind           symbols.SymbolKind `json:"kind"`
}

type DocumentSymbolParams

type DocumentSymbolParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

type ExecuteCommandOptions

type ExecuteCommandOptions struct {
	Commands []string `json:"commands"`
}

type ExecuteCommandParams

type ExecuteCommandParams struct {
	Command   string `json:"command"`
	Arguments []any  `json:"arguments"`
}

type FileDiagnostics

type FileDiagnostics struct {
	URI   string       `json:"uri"`
	Items []Diagnostic `json:"diagnostics"`
}

type FileEvent

type FileEvent struct {
	URI  string `json:"uri"`
	Type uint   `json:"type"`
}

type FileOperationFilter

type FileOperationFilter struct {
	Scheme  string               `json:"scheme"`
	Pattern FileOperationPattern `json:"pattern"`
}

type FileOperationPattern

type FileOperationPattern struct {
	Glob string `json:"glob"`
}

type FileOperationRegistrationOptions

type FileOperationRegistrationOptions struct {
	Filters []FileOperationFilter `json:"filters"`
}

type FileOperationsServerCapabilities

type FileOperationsServerCapabilities struct {
	DidCreate FileOperationRegistrationOptions `json:"didCreate"`
	DidRename FileOperationRegistrationOptions `json:"didRename"`
	DidDelete FileOperationRegistrationOptions `json:"didDelete"`
}

type FoldingRange

type FoldingRange struct {
	StartCharacter *uint  `json:"startCharacter,omitempty"`
	EndCharacter   *uint  `json:"endCharacter,omitempty"`
	Kind           string `json:"kind"`
	StartLine      uint   `json:"startLine"`
	EndLine        uint   `json:"endLine"`
}

type FoldingRangeParams

type FoldingRangeParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

type FormattingOptions

type FormattingOptions struct {
	TabSize                uint `json:"tabSize"`
	InsertSpaces           bool `json:"insertSpaces"`
	TrimTrailingWhitespace bool `json:"trimTrailingWhitespace"`
	InsertFinalNewline     bool `json:"insertFinalNewline"`
	TrimFinalNewlines      bool `json:"trimFinalNewlines"`
}

type GeneralClientCapabilities

type GeneralClientCapabilities struct {
	StaleRequestSupport StaleRequestSupportClientCapabilities `json:"staleRequestSupport"`
}

type InitializationOptions added in v0.25.0

type InitializationOptions struct {
	// Formatter specifies the formatter to use. Options: 'opa fmt' (default),
	// 'opa fmt --rego-v1' or 'regal fix'.
	Formatter *string `json:"formatter,omitempty"`
	// EnableDebugCodelens, if set, will enable debug codelens
	// when clients request code lenses for a file.
	EnableDebugCodelens *bool `json:"enableDebugCodelens,omitempty"`
	// EvalCodelensDisplayInline, if set, will show evaluation results natively
	// in the calling editor, rather than in an output file.
	EvalCodelensDisplayInline *bool `json:"evalCodelensDisplayInline,omitempty"`
}

type InitializeParams

type InitializeParams struct {
	InitializationOptions *InitializationOptions `json:"initializationOptions,omitempty"`
	ClientInfo            Client                 `json:"clientInfo"`
	Locale                string                 `json:"locale"`
	RootPath              string                 `json:"rootPath"`
	RootURI               string                 `json:"rootUri"`
	Trace                 string                 `json:"trace"`
	WorkspaceFolders      []WorkspaceFolder      `json:"workspaceFolders"`
	Capabilities          ClientCapabilities     `json:"capabilities"`
	ProcessID             int                    `json:"processId"`
}

type InitializeResult

type InitializeResult struct {
	Capabilities ServerCapabilities `json:"capabilities"`
}

type InlayHint

type InlayHint struct {
	Tooltip      MarkupContent `json:"tooltip"`
	Label        string        `json:"label"`
	Position     Position      `json:"position"`
	Kind         uint          `json:"kind"`
	PaddingLeft  bool          `json:"paddingLeft"`
	PaddingRight bool          `json:"paddingRight"`
}

type InlayHintOptions

type InlayHintOptions struct {
	ResolveProvider bool `json:"resolveProvider"`
}

type KeywordLocation added in v0.24.0

type KeywordLocation struct {
	Name  string
	Line  uint
	Start uint
	End   uint
}

type Location

type Location struct {
	URI   string `json:"uri"`
	Range Range  `json:"range"`
}

type MarkupContent

type MarkupContent struct {
	Kind  string `json:"kind"`
	Value string `json:"value"`
}

type OptionalVersionedTextDocumentIdentifier

type OptionalVersionedTextDocumentIdentifier struct {
	// Version is optional (i.e. it can be null), but it cannot be undefined when used in some requests
	// (see workspace/applyEdit).
	Version *uint  `json:"version"`
	URI     string `json:"uri"`
}

type Position

type Position struct {
	Line      uint `json:"line"`
	Character uint `json:"character"`
}

type Range

type Range struct {
	Start Position `json:"start"`
	End   Position `json:"end"`
}

type Ref added in v0.23.0

type Ref struct {
	// Label is a identifier for the object. e.g. data.package.rule.
	Label string `json:"label"`
	// Detail is a small amount of additional information about the object.
	Detail string `json:"detail"`
	// Description is a longer description of the object and uses Markdown formatting.
	Description string  `json:"description"`
	Kind        RefKind `json:"kind"`
}

Ref is a generic construct for an object found in a Rego module. Ref is designed to be used in completions and provides information relevant to the object with that operation in mind.

type RefKind added in v0.23.0

type RefKind int

RefKind represents the kind of object that a Ref represents. This is intended to toggle functionality and which UI symbols to use.

const (
	Package RefKind = iota + 1
	Rule
	ConstantRule
	Function
)

type RenameFile added in v0.26.0

type RenameFile struct {
	Options              *RenameFileOptions `json:"options,omitempty"`
	AnnotationIdentifier *string            `json:"annotationId,omitempty"`
	Kind                 string             `json:"kind"` // must always be "rename"
	OldURI               string             `json:"oldUri"`
	NewURI               string             `json:"newUri"`
}

type RenameFileOptions added in v0.26.0

type RenameFileOptions struct {
	Overwrite      bool `json:"overwrite"`
	IgnoreIfExists bool `json:"ignoreIfExists"`
}

type ServerCapabilities

type ServerCapabilities struct {
	CodeLensProvider           *CodeLensOptions        `json:"codeLensProvider,omitempty"`
	Workspace                  WorkspaceOptions        `json:"workspace"`
	DiagnosticProvider         DiagnosticOptions       `json:"diagnosticProvider"`
	CodeActionProvider         CodeActionOptions       `json:"codeActionProvider"`
	ExecuteCommandProvider     ExecuteCommandOptions   `json:"executeCommandProvider"`
	TextDocumentSyncOptions    TextDocumentSyncOptions `json:"textDocumentSync"`
	CompletionProvider         CompletionOptions       `json:"completionProvider"`
	InlayHintProvider          InlayHintOptions        `json:"inlayHintProvider"`
	HoverProvider              bool                    `json:"hoverProvider"`
	DocumentFormattingProvider bool                    `json:"documentFormattingProvider"`
	FoldingRangeProvider       bool                    `json:"foldingRangeProvider"`
	DocumentSymbolProvider     bool                    `json:"documentSymbolProvider"`
	WorkspaceSymbolProvider    bool                    `json:"workspaceSymbolProvider"`
	DefinitionProvider         bool                    `json:"definitionProvider"`
}

type ShowMessageParams added in v0.22.0

type ShowMessageParams struct {
	Message string `json:"message"`
	Type    uint   `json:"type"`
}

type StaleRequestSupportClientCapabilities

type StaleRequestSupportClientCapabilities struct {
	RetryOnContentModified []string `json:"retryOnContentModified"`
	Cancel                 bool     `json:"cancel"`
}

type TextDocumentClientCapabilities

type TextDocumentClientCapabilities struct {
	Diagnostic DiagnosticClientCapabilities `json:"diagnostic"`
}

type TextDocumentContentChangeEvent

type TextDocumentContentChangeEvent struct {
	Text string `json:"text"`
}

type TextDocumentDidChangeParams

type TextDocumentDidChangeParams struct {
	TextDocument   TextDocumentIdentifier           `json:"textDocument"`
	ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"`
}

type TextDocumentDidCloseParams added in v0.24.0

type TextDocumentDidCloseParams struct {
	TextDocument TextDocumentItem `json:"textDocument"`
}

type TextDocumentDidOpenParams

type TextDocumentDidOpenParams struct {
	TextDocument TextDocumentItem `json:"textDocument"`
}

type TextDocumentDidSaveParams added in v0.22.0

type TextDocumentDidSaveParams struct {
	Text         *string                `json:"text,omitempty"`
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

type TextDocumentEdit

type TextDocumentEdit struct {
	// TextDocument is the document to change. Not that this could be versioned,
	// (OptionalVersionedTextDocumentIdentifier) but we currently don't use that.
	TextDocument OptionalVersionedTextDocumentIdentifier `json:"textDocument"`
	Edits        []TextEdit                              `json:"edits"`
}

type TextDocumentHoverParams

type TextDocumentHoverParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Position     Position               `json:"position"`
}

type TextDocumentIdentifier

type TextDocumentIdentifier struct {
	URI string `json:"uri"`
}

type TextDocumentInlayHintParams

type TextDocumentInlayHintParams struct {
	TextDocument TextDocumentIdentifier `json:"textDocument"`
	Range        Range                  `json:"range"`
}

type TextDocumentItem

type TextDocumentItem struct {
	LanguageID string `json:"languageId"`
	Text       string `json:"text"`
	URI        string `json:"uri"`
	Version    uint   `json:"version"`
}

type TextDocumentSaveOptions added in v0.22.0

type TextDocumentSaveOptions struct {
	IncludeText bool `json:"includeText"`
}

type TextDocumentSyncOptions

type TextDocumentSyncOptions struct {
	Change    uint                    `json:"change"`
	OpenClose bool                    `json:"openClose"`
	Save      TextDocumentSaveOptions `json:"save"`
}

type TextEdit

type TextEdit struct {
	NewText string `json:"newText"`
	Range   Range  `json:"range"`
}

type WindowClientCapabilities

type WindowClientCapabilities struct {
	WorkDoneProgress bool `json:"workDoneProgress"`
}

type WorkspaceClientCapabilities

type WorkspaceClientCapabilities struct {
	Diagnostics DiagnosticWorkspaceClientCapabilities `json:"diagnostics"`
}

type WorkspaceDiagnosticReport

type WorkspaceDiagnosticReport struct {
	Items []WorkspaceFullDocumentDiagnosticReport `json:"items"`
}

type WorkspaceDidChangeWatchedFilesParams

type WorkspaceDidChangeWatchedFilesParams struct {
	Changes []FileEvent `json:"changes"`
}

type WorkspaceDidCreateFilesParams

type WorkspaceDidCreateFilesParams struct {
	Files []WorkspaceDidCreateFilesParamsCreatedFile `json:"files"`
}

type WorkspaceDidCreateFilesParamsCreatedFile

type WorkspaceDidCreateFilesParamsCreatedFile struct {
	URI string `json:"uri"`
}

type WorkspaceDidDeleteFilesParams

type WorkspaceDidDeleteFilesParams struct {
	Files []WorkspaceDidDeleteFilesParamsDeletedFile `json:"files"`
}

type WorkspaceDidDeleteFilesParamsDeletedFile

type WorkspaceDidDeleteFilesParamsDeletedFile struct {
	URI string `json:"uri"`
}

type WorkspaceDidRenameFilesParams

type WorkspaceDidRenameFilesParams struct {
	Files []WorkspaceDidRenameFilesParamsFileRename `json:"files"`
}

type WorkspaceDidRenameFilesParamsFileRename

type WorkspaceDidRenameFilesParamsFileRename struct {
	NewURI string `json:"newUri"`
	OldURI string `json:"oldUri"`
}

type WorkspaceEdit

type WorkspaceEdit struct {
	DocumentChanges []TextDocumentEdit `json:"documentChanges"`
}

type WorkspaceFolder

type WorkspaceFolder struct {
	URI  string `json:"uri"`
	Name string `json:"name"`
}

type WorkspaceFullDocumentDiagnosticReport

type WorkspaceFullDocumentDiagnosticReport struct {
	URI     string       `json:"uri"`
	Version *uint        `json:"version"`
	Kind    string       `json:"kind"` // full, or incremental. We always use full
	Items   []Diagnostic `json:"items"`
}

type WorkspaceOptions

type WorkspaceOptions struct {
	FileOperations FileOperationsServerCapabilities `json:"fileOperations"`
}

type WorkspaceRenameEdit added in v0.26.0

type WorkspaceRenameEdit struct {
	DocumentChanges []RenameFile `json:"documentChanges"`
}

WorkspaceRenameEdit is a WorkspaceEdit that is used for renaming files. Perhaps we should use generics and a union type here instead.

type WorkspaceSymbol

type WorkspaceSymbol struct {
	ContainerName *string            `json:"containerName,omitempty"`
	Name          string             `json:"name"`
	Location      Location           `json:"location"`
	Kind          symbols.SymbolKind `json:"kind"`
}

type WorkspaceSymbolParams

type WorkspaceSymbolParams struct {
	Query string `json:"query"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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