Documentation ¶
Index ¶
- func ComputeEdits(before, after string) []types.TextEdit
- func DirectoryStructureMismatchCommand(args []string) types.Command
- func FmtCommand(args []string) types.Command
- func FmtV1Command(args []string) types.Command
- func NewConnectionFromLanguageServer(ctx context.Context, handler ConnectionHandlerFunc, opts *ConnectionOptions) *jsonrpc2.Conn
- func NewRegalStore() storage.Store
- func NoWhiteSpaceCommentCommand(args []string) types.Command
- func PutFileMod(ctx context.Context, store storage.Store, fileURI string, mod *ast.Module) error
- func PutFileRefs(ctx context.Context, store storage.Store, fileURI string, refs []string) error
- func RemoveFileMod(ctx context.Context, store storage.Store, fileURI string) error
- func TokenFoldingRanges(policy string) []types.FoldingRange
- func UseAssignmentOperatorCommand(args []string) types.Command
- type ConnectionHandlerFunc
- type ConnectionLoggingConfig
- type ConnectionOptions
- type EvalPathResult
- type HoverResponse
- type LanguageServer
- func (l *LanguageServer) Eval(ctx context.Context, query string, input io.Reader, printHook print.Hook, ...) (rego.ResultSet, error)
- func (l *LanguageServer) EvalWorkspacePath(ctx context.Context, query string, input io.Reader) (EvalPathResult, error)
- func (l *LanguageServer) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) (result any, err error)
- func (l *LanguageServer) SetConn(conn *jsonrpc2.Conn)
- func (l *LanguageServer) StartCommandWorker(ctx context.Context)
- func (l *LanguageServer) StartConfigWorker(ctx context.Context)
- func (l *LanguageServer) StartDiagnosticsWorker(ctx context.Context)
- func (l *LanguageServer) StartHoverWorker(ctx context.Context)
- func (l *LanguageServer) StartTemplateWorker(ctx context.Context)
- func (l *LanguageServer) StartWebServer(ctx context.Context)
- func (l *LanguageServer) StartWorkspaceStateWorker(ctx context.Context)
- type LanguageServerOptions
- type OpKind
- type PrintHook
- type StdOutReadWriteCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeEdits ¶ added in v0.21.0
ComputeEdits computes diff edits from 2 string inputs.
func DirectoryStructureMismatchCommand ¶ added in v0.26.0
func FmtCommand ¶ added in v0.21.0
func FmtV1Command ¶ added in v0.21.0
func NewConnectionFromLanguageServer ¶ added in v0.21.0
func NewConnectionFromLanguageServer( ctx context.Context, handler ConnectionHandlerFunc, opts *ConnectionOptions, ) *jsonrpc2.Conn
func NewRegalStore ¶ added in v0.24.0
func NoWhiteSpaceCommentCommand ¶ added in v0.21.0
func PutFileMod ¶ added in v0.24.0
func PutFileRefs ¶ added in v0.24.0
func RemoveFileMod ¶ added in v0.24.0
func TokenFoldingRanges ¶ added in v0.21.0
func TokenFoldingRanges(policy string) []types.FoldingRange
nolint:gosec
func UseAssignmentOperatorCommand ¶ added in v0.21.0
Types ¶
type ConnectionHandlerFunc ¶ added in v0.21.0
type ConnectionLoggingConfig ¶ added in v0.21.0
type ConnectionLoggingConfig struct { Writer io.Writer // IncludeMethods is a list of methods to include in the request log. // If empty, all methods are included. IncludeMethods takes precedence // over ExcludeMethods. IncludeMethods []string // ExcludeMethods is a list of methods to exclude from the request log. ExcludeMethods []string LogInbound bool LogOutbound bool }
func (*ConnectionLoggingConfig) ShouldLog ¶ added in v0.21.0
func (cfg *ConnectionLoggingConfig) ShouldLog(method string) bool
type ConnectionOptions ¶ added in v0.21.0
type ConnectionOptions struct {
LoggingConfig ConnectionLoggingConfig
}
type EvalPathResult ¶ added in v0.25.0
type HoverResponse ¶ added in v0.20.0
type HoverResponse struct { Contents types.MarkupContent `json:"contents"` Range types.Range `json:"range"` }
type LanguageServer ¶
type LanguageServer struct {
// contains filtered or unexported fields
}
func NewLanguageServer ¶
func NewLanguageServer(ctx context.Context, opts *LanguageServerOptions) *LanguageServer
func (*LanguageServer) EvalWorkspacePath ¶ added in v0.25.0
func (l *LanguageServer) EvalWorkspacePath( ctx context.Context, query string, input io.Reader, ) (EvalPathResult, error)
func (*LanguageServer) SetConn ¶
func (l *LanguageServer) SetConn(conn *jsonrpc2.Conn)
func (*LanguageServer) StartCommandWorker ¶ added in v0.21.0
func (l *LanguageServer) StartCommandWorker(ctx context.Context)
func (*LanguageServer) StartConfigWorker ¶ added in v0.21.0
func (l *LanguageServer) StartConfigWorker(ctx context.Context)
func (*LanguageServer) StartDiagnosticsWorker ¶
func (l *LanguageServer) StartDiagnosticsWorker(ctx context.Context)
func (*LanguageServer) StartHoverWorker ¶ added in v0.20.0
func (l *LanguageServer) StartHoverWorker(ctx context.Context)
func (*LanguageServer) StartTemplateWorker ¶ added in v0.26.0
func (l *LanguageServer) StartTemplateWorker(ctx context.Context)
StartTemplateWorker runs the process of the server that templates newly created Rego files.
func (*LanguageServer) StartWebServer ¶ added in v0.27.0
func (l *LanguageServer) StartWebServer(ctx context.Context)
func (*LanguageServer) StartWorkspaceStateWorker ¶ added in v0.25.0
func (l *LanguageServer) StartWorkspaceStateWorker(ctx context.Context)
StartWorkspaceStateWorker will poll for changes to the workspaces state that are not sent from the client. For example, when a file a is removed from the workspace after changing branch.
type LanguageServerOptions ¶
type LanguageServerOptions struct { // LogWriter is the io.Writer where all logged messages will be written. LogWriter io.Writer // log.Level controls the verbosity of the logs, with log.LevelOff, no messages // are logged, log.LevelMessage logs only messages and errors, and log.LevelDebug // Logs all messages. LogLevel log.Level // WorkspaceDiagnosticsPoll, if set > 0 will cause a full workspace lint // to run on this interval. This is intended to be used where eventing // is not working, as expected. E.g. with a client that does not send // changes or when running in extremely slow environments like GHA with // the go race detector on. TODO, work out why this is required. WorkspaceDiagnosticsPoll time.Duration }
type OpKind ¶ added in v0.21.0
type OpKind int
OpKind is used to denote the type of operation a line represents.
const ( // Delete is the operation kind for a line that is present in the input // but not in the output. Delete OpKind = iota // Insert is the operation kind for a line that is new in the output. Insert // Equal is the operation kind for a line that is the same in the input and // output, often used to provide context around edited lines. Equal )
type StdOutReadWriteCloser ¶
type StdOutReadWriteCloser struct{}
func (StdOutReadWriteCloser) Close ¶
func (StdOutReadWriteCloser) Close() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.