Documentation
¶
Index ¶
- Variables
- func CLI(args []string) error
- func Deref[T any](t *T) T
- func Execute(ctx context.Context, cfg *Config) error
- func NewCmdPipeListener(ctx context.Context, cmd *exec.Cmd) (jsonrpc2.Listener, error)
- func NewIOPipeListener(ctx context.Context, r io.Reader, w io.Writer) (jsonrpc2.Listener, error)
- func SliceFor[T any](t T, n int) []T
- type Binder
- type ClientHandler
- type Config
- type DiagnosticRegistry
- type Middleware
- type MiddlewareBinder
- type ServerConfig
- type ServerConnection
- func (c *ServerConnection) Call(ctx context.Context, method string, params any, res any) error
- func (c *ServerConnection) CallWithRawResult(ctx context.Context, method string, params any) (json.RawMessage, error)
- func (c *ServerConnection) Close() error
- func (c *ServerConnection) Notify(ctx context.Context, method string, params any) error
- type ServerConnectionList
- type ServerConnectionRegistry
- type ServerHandler
- type VuelsTSServerRequestInterceptor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrParse = jsonrpc2.ErrParse ErrInvalidRequest = jsonrpc2.ErrInvalidRequest ErrMethodNotFound = jsonrpc2.ErrMethodNotFound ErrInvalidParams = jsonrpc2.ErrInvalidParams ErrUnknown = jsonrpc2.ErrUnknown ErrInternal = jsonrpc2.ErrInternal ErrServerOverloaded = jsonrpc2.ErrServerOverloaded )
Functions ¶
func NewCmdPipeListener ¶
func NewIOPipeListener ¶
Types ¶
type Binder ¶
type Binder struct {
// contains filtered or unexported fields
}
func (Binder) Bind ¶
func (b Binder) Bind(ctx context.Context, conn *jsonrpc2.Connection) (jsonrpc2.ConnectionOptions, error)
type ClientHandler ¶
type ClientHandler struct {
// contains filtered or unexported fields
}
func NewClientHandler ¶
func NewClientHandler(serverRegistry *ServerConnectionRegistry) *ClientHandler
func (*ClientHandler) WaitExit ¶
func (h *ClientHandler) WaitExit()
type Config ¶
type Config struct {
LogLevel slog.Level `yaml:"logLevel"`
Servers []ServerConfig `yaml:"servers"` // use slice to respect config order
}
type DiagnosticRegistry ¶
type DiagnosticRegistry struct {
// contains filtered or unexported fields
}
func NewDiagnosticRegistry ¶
func NewDiagnosticRegistry() *DiagnosticRegistry
func (*DiagnosticRegistry) GetDiagnostics ¶
func (r *DiagnosticRegistry) GetDiagnostics(uri protocol.DocumentUri) []protocol.Diagnostic
func (*DiagnosticRegistry) UpdateDiagnostics ¶
func (r *DiagnosticRegistry) UpdateDiagnostics(uri protocol.DocumentUri, serverName string, diags []protocol.Diagnostic)
type Middleware ¶
func ContextLogMiddleware ¶
func ContextLogMiddleware(name string) Middleware
func LoggingMiddleware ¶
func LoggingMiddleware() Middleware
type MiddlewareBinder ¶
type MiddlewareBinder struct {
// contains filtered or unexported fields
}
func NewMiddlewareBinder ¶
func NewMiddlewareBinder(binder jsonrpc2.Binder, middlewares ...Middleware) *MiddlewareBinder
func (*MiddlewareBinder) Bind ¶
func (mb *MiddlewareBinder) Bind(ctx context.Context, conn *jsonrpc2.Connection) (jsonrpc2.ConnectionOptions, error)
type ServerConfig ¶
type ServerConnection ¶
type ServerConnection struct {
Name string
InitOptions map[string]any
SupportedCapabilities capability.SupportedSet
Capabilities *protocol.ServerCapabilities
// contains filtered or unexported fields
}
func (*ServerConnection) CallWithRawResult ¶
func (c *ServerConnection) CallWithRawResult(ctx context.Context, method string, params any) (json.RawMessage, error)
func (*ServerConnection) Close ¶
func (c *ServerConnection) Close() error
type ServerConnectionList ¶
type ServerConnectionList []*ServerConnection
func (ServerConnectionList) FilterBySupportedMethod ¶
func (l ServerConnectionList) FilterBySupportedMethod(method string) ServerConnectionList
func (ServerConnectionList) FindByCommand ¶
func (l ServerConnectionList) FindByCommand(command string) (*ServerConnection, bool)
func (ServerConnectionList) FindByName ¶
func (l ServerConnectionList) FindByName(name string) (*ServerConnection, bool)
type ServerConnectionRegistry ¶
type ServerConnectionRegistry struct {
// contains filtered or unexported fields
}
func NewServerConnectionRegistry ¶
func NewServerConnectionRegistry(nservers int) *ServerConnectionRegistry
func (*ServerConnectionRegistry) Add ¶
func (r *ServerConnectionRegistry) Add(ctx context.Context, name string, conn *jsonrpc2.Connection, initOptions map[string]any)
func (*ServerConnectionRegistry) Servers ¶
func (r *ServerConnectionRegistry) Servers() ServerConnectionList
type ServerHandler ¶
type ServerHandler struct {
// contains filtered or unexported fields
}
func NewServerHandler ¶
func NewServerHandler(name string, clientConn *jsonrpc2.Connection, diagRegistry *DiagnosticRegistry) *ServerHandler
type VuelsTSServerRequestInterceptor ¶
type VuelsTSServerRequestInterceptor struct {
// contains filtered or unexported fields
}
VuelsTSServerRequestInterceptor intercepts "tsserver/request" notifications to support vuels v3 features. see https://github.com/vuejs/language-tools/discussions/5456
func NewVuelsTSServerRequestInterceptor ¶
func NewVuelsTSServerRequestInterceptor(name string, serverRegistry *ServerConnectionRegistry) *VuelsTSServerRequestInterceptor
Source Files
¶
Click to show internal directories.
Click to hide internal directories.