proxy

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package proxy implements the protocol between acme-lsp and L commands.

Index

Constants

View Source
const Debug = false
View Source
const Version = 1

Version is used to detect if acme-lsp and L are speaking the same protocol.

Variables

This section is empty.

Functions

func NewClientHandler

func NewClientHandler(client Client) jsonrpc2.Handler

func NewServerHandler

func NewServerHandler(server Server) jsonrpc2.Handler

func WithClient

func WithClient(ctx context.Context, client Client) context.Context

Types

type Client

type Client interface {
	protocol.Client
}

func NewClient

func NewClient(conn *jsonrpc2.Conn) Client

type DocumentUri

type DocumentUri = string

type ExecuteCommandOnDocumentParams

type ExecuteCommandOnDocumentParams struct {
	TextDocument         protocol.TextDocumentIdentifier
	ExecuteCommandParams protocol.ExecuteCommandParams
}

type NotImplementedClient

type NotImplementedClient struct{}

func (*NotImplementedClient) CodeLensRefresh

func (c *NotImplementedClient) CodeLensRefresh(context.Context) error

workspace/codeLens/refresh

func (*NotImplementedClient) Configuration

func (c *NotImplementedClient) Configuration(context.Context, *protocol.ParamConfiguration) ([]interface{}, error)

func (*NotImplementedClient) DiagnosticRefresh

func (c *NotImplementedClient) DiagnosticRefresh(context.Context) error

workspace/diagnostic/refresh

func (*NotImplementedClient) Event

func (c *NotImplementedClient) Event(context.Context, *interface{}) error

func (*NotImplementedClient) InlayHintRefresh

func (c *NotImplementedClient) InlayHintRefresh(context.Context) error

workspace/inlayHint/refresh

func (*NotImplementedClient) InlineValueRefresh

func (c *NotImplementedClient) InlineValueRefresh(context.Context) error

workspace/inlineValue/refresh

func (*NotImplementedClient) LogMessage

func (c *NotImplementedClient) LogMessage(ctx context.Context, params *protocol.LogMessageParams) error

func (*NotImplementedClient) LogTrace

$/logTrace

func (*NotImplementedClient) Progress

$/progress

func (*NotImplementedClient) PublishDiagnostics

func (*NotImplementedClient) RegisterCapability

func (*NotImplementedClient) SemanticTokensRefresh

func (c *NotImplementedClient) SemanticTokensRefresh(context.Context) error

workspace/semanticTokens/refresh

func (*NotImplementedClient) ShowDocument

window/showDocument

func (*NotImplementedClient) ShowMessage

func (*NotImplementedClient) UnregisterCapability

func (*NotImplementedClient) WorkDoneProgressCreate

window/workDoneProgress/create

func (*NotImplementedClient) WorkspaceFolders

type NotImplementedServer

type NotImplementedServer struct{}

NotImplementedServer is a stub implementation of protocol.Server.

func (*NotImplementedServer) CodeAction

func (*NotImplementedServer) CodeLens

func (*NotImplementedServer) ColorPresentation

func (*NotImplementedServer) Completion

func (*NotImplementedServer) Definition

func (*NotImplementedServer) Diagnostic

func (s *NotImplementedServer) Diagnostic(context.Context, *string) (*string, error)

func (*NotImplementedServer) DidChange

func (*NotImplementedServer) DidChangeConfiguration

func (*NotImplementedServer) DidChangeNotebookDocument

func (*NotImplementedServer) DidChangeWatchedFiles

func (*NotImplementedServer) DidChangeWorkspaceFolders

func (*NotImplementedServer) DidClose

func (*NotImplementedServer) DidCloseNotebookDocument

func (*NotImplementedServer) DidCreateFiles

func (*NotImplementedServer) DidDeleteFiles

func (*NotImplementedServer) DidOpen

func (*NotImplementedServer) DidOpenNotebookDocument

func (*NotImplementedServer) DidRenameFiles

func (*NotImplementedServer) DidSave

func (*NotImplementedServer) DidSaveNotebookDocument

func (*NotImplementedServer) DocumentColor

func (*NotImplementedServer) DocumentHighlight

func (*NotImplementedServer) DocumentSymbol

func (s *NotImplementedServer) DocumentSymbol(context.Context, *protocol.DocumentSymbolParams) ([]interface{}, error)

func (*NotImplementedServer) ExecuteCommand

func (s *NotImplementedServer) ExecuteCommand(context.Context, *protocol.ExecuteCommandParams) (interface{}, error)

func (*NotImplementedServer) Exit

func (*NotImplementedServer) FoldingRange

func (*NotImplementedServer) Formatting

func (*NotImplementedServer) Hover

func (*NotImplementedServer) Implementation

func (*NotImplementedServer) Initialize

func (*NotImplementedServer) Initialized

func (*NotImplementedServer) InlayHint

func (*NotImplementedServer) InlineValue

func (*NotImplementedServer) Moniker

func (*NotImplementedServer) NonstandardRequest

func (s *NotImplementedServer) NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error)

func (*NotImplementedServer) OnTypeFormatting

func (*NotImplementedServer) PrepareRename

func (*NotImplementedServer) Progress

func (*NotImplementedServer) RangeFormatting

func (*NotImplementedServer) References

func (*NotImplementedServer) Rename

func (*NotImplementedServer) Resolve

func (*NotImplementedServer) ResolveCodeAction

func (*NotImplementedServer) ResolveCodeLens

func (*NotImplementedServer) ResolveCompletionItem

func (*NotImplementedServer) ResolveWorkspaceSymbol

func (*NotImplementedServer) SelectionRange

func (*NotImplementedServer) SemanticTokensFull

func (*NotImplementedServer) SemanticTokensFullDelta

func (s *NotImplementedServer) SemanticTokensFullDelta(context.Context, *protocol.SemanticTokensDeltaParams) (interface{}, error)

func (*NotImplementedServer) SemanticTokensRange

func (*NotImplementedServer) SetTrace

func (*NotImplementedServer) Shutdown

func (*NotImplementedServer) SignatureHelp

func (*NotImplementedServer) TypeDefinition

func (*NotImplementedServer) WillCreateFiles

func (*NotImplementedServer) WillDeleteFiles

func (*NotImplementedServer) WillRenameFiles

func (*NotImplementedServer) WillSave

func (*NotImplementedServer) WillSaveWaitUntil

func (*NotImplementedServer) WorkDoneProgressCancel

type Server

type Server interface {
	// Version returns the protocol version.
	Version(context.Context) (int, error)

	// WorkspaceFolders returns the workspace folders currently being managed by acme-lsp.
	// In LSP, this method is implemented by the client, but in our case acme-lsp is managing
	// the workspace folders, so this has to be implemented by the acme-lsp proxy server.
	WorkspaceFolders(context.Context) ([]protocol.WorkspaceFolder, error)

	// InitializeResult returns the initialize response from the LSP server.
	// This is useful for L command to get initialization results (e.g. server capabilities)
	// of an already initialized LSP server.
	InitializeResult(context.Context, *protocol.TextDocumentIdentifier) (*protocol.InitializeResult, error)

	// ExecuteCommandOnDocument is the same as ExecuteCommand, but
	// params contain the TextDocumentIdentifier of the original
	// CodeAction so that the server implemention can multiplex
	// ExecuteCommand request to the right server.
	ExecuteCommandOnDocument(context.Context, *ExecuteCommandOnDocumentParams) (interface{}, error)

	protocol.Server
}

Server implements a subset of an LSP protocol server as defined by protocol.Server and some custom acme-lsp specific methods.

func NewServer

func NewServer(conn *jsonrpc2.Conn) Server

Jump to

Keyboard shortcuts

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