lsp

package
v1.38.1 Latest Latest
Warning

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

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

Documentation

Overview

Package lsp implements the Language Server Protocol for SpiceDB schema development.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCapabilities

type ClientCapabilities struct {
	Diagnostics DiagnosticWorkspaceClientCapabilities `json:"diagnostics,omitempty"`
}

type DiagnosticOptions

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

type DiagnosticWorkspaceClientCapabilities

type DiagnosticWorkspaceClientCapabilities struct {
	// RefreshSupport indicates whether the client supports the new
	// `textDocument/diagnostic` request.
	RefreshSupport bool `json:"refreshSupport,omitempty"`
}

type FullDocumentDiagnosticReport

type FullDocumentDiagnosticReport struct {
	Kind     string               `json:"kind"`
	Items    []baselsp.Diagnostic `json:"items"`
	ResultID string               `json:"resultId,omitempty"`
}

type Hover

type Hover struct {
	Contents MarkupContent  `json:"contents"`
	Range    *baselsp.Range `json:"range,omitempty"`
}

type InitializeParams

type InitializeParams struct {
	ProcessID int `json:"processId,omitempty"`

	// RootPath is DEPRECATED in favor of the RootURI field.
	RootPath string `json:"rootPath,omitempty"`

	RootURI               baselsp.DocumentURI `json:"rootUri,omitempty"`
	ClientInfo            baselsp.ClientInfo  `json:"clientInfo,omitempty"`
	Trace                 baselsp.Trace       `json:"trace,omitempty"`
	InitializationOptions interface{}         `json:"initializationOptions,omitempty"`
	Capabilities          ClientCapabilities  `json:"capabilities"`

	WorkDoneToken string `json:"workDoneToken,omitempty"`
}

type InitializeResult

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

type MarkupContent

type MarkupContent struct {
	Kind     string `json:"kind,omitempty"`
	Language string `json:"language,omitempty"`
	Value    string `json:"value"`
}

type Server

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

Server is a Language Server Protocol server for SpiceDB schema development.

func NewServer

func NewServer() *Server

NewServer returns a new Server.

func (*Server) Handle

func (s *Server) Handle(ctx context.Context, conn *jsonrpc2.Conn, r *jsonrpc2.Request)

func (*Server) Run

func (s *Server) Run(ctx context.Context, addr string, stdio bool) error

Run binds to the provided address and concurrently serves Language Server Protocol requests.

type ServerCapabilities

type ServerCapabilities struct {
	TextDocumentSync           *baselsp.TextDocumentSyncOptionsOrKind `json:"textDocumentSync,omitempty"`
	CompletionProvider         *baselsp.CompletionOptions             `json:"completionProvider,omitempty"`
	DocumentFormattingProvider bool                                   `json:"documentFormattingProvider,omitempty"`
	DiagnosticProvider         *DiagnosticOptions                     `json:"diagnosticProvider,omitempty"`
	HoverProvider              bool                                   `json:"hoverProvider,omitempty"`
}

type TextDocument

type TextDocument struct {
	URI baselsp.DocumentURI `json:"uri"`
}

type TextDocumentDiagnosticParams

type TextDocumentDiagnosticParams struct {
	Identifier   string       `json:"identifier"`
	TextDocument TextDocument `json:"textDocument"`
}

Jump to

Keyboard shortcuts

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