types

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 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 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 {
	Workspace WorkspaceClientCapabilities    `json:"workspace"`
	Text      TextDocumentClientCapabilities `json:"textDocument"`
	Window    WindowClientCapabilities       `json:"window"`
	General   GeneralClientCapabilities      `json:"general"`
}

type CodeAction

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

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"`
	Range        Range                  `json:"range"`
	Context      CodeActionContext      `json:"context"`
}

type CodeDescription

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

type Command

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

type CompletionContext added in v0.22.0

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

type CompletionItem added in v0.22.0

type CompletionItem struct {
	Label        string                      `json:"label"`
	LabelDetails *CompletionItemLabelDetails `json:"labelDetails,omitempty"`
	// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItemKind
	Kind          completion.ItemKind `json:"kind"`
	Detail        string              `json:"detail"`
	Documentation *MarkupContent      `json:"documentation,omitempty"`
	Preselect     bool                `json:"preselect"`
	TextEdit      *TextEdit           `json:"textEdit,omitempty"`

	// 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 CompletionList added in v0.22.0

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

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"`
	Position     Position               `json:"position"`
	Context      CompletionContext      `json:"context"`
}

type DefinitionParams

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

type Diagnostic

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

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 {
	Name           string             `json:"name"`
	Detail         *string            `json:"detail,omitempty"`
	Kind           symbols.SymbolKind `json:"kind"`
	Range          Range              `json:"range"`
	SelectionRange Range              `json:"selectionRange"`
	Children       *[]DocumentSymbol  `json:"children,omitempty"`
}

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 {
	Type uint   `json:"type"`
	URI  string `json:"uri"`
}

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 {
	StartLine      uint   `json:"startLine"`
	StartCharacter *uint  `json:"startCharacter,omitempty"`
	EndLine        uint   `json:"endLine"`
	EndCharacter   *uint  `json:"endCharacter,omitempty"`
	Kind           string `json:"kind"`
}

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 InitializeParams

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

type InitializeResult

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

type InlayHint

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

type InlayHintOptions

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

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 {
	URI string `json:"uri"`
	// 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"`
}

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 {
	Kind RefKind
	// Label is a identifier for the object. e.g. data.package.rule.
	Label string
	// Detail is a small amount of additional information about the object.
	Detail string
	// Description is a longer description of the object and uses Markdown formatting.
	Description string
}

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 ServerCapabilities

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

type ShowMessageParams added in v0.22.0

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

type StaleRequestSupportClientCapabilities

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

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 TextDocumentDidOpenParams

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

type TextDocumentDidSaveParams added in v0.22.0

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

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 {
	Position     Position               `json:"position"`
	TextDocument TextDocumentIdentifier `json:"textDocument"`
}

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 {
	OpenClose bool                    `json:"openClose"`
	Change    uint                    `json:"change"`
	Save      TextDocumentSaveOptions `json:"save"`
}

type TextEdit

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

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 WorkspaceSymbol

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

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