server

package
v0.0.0-...-5689e7e Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type FallbackServer

type FallbackServer struct{}

FallbackServer is a complete implementation of the protocol.Server interface that responds with a "method not found" error for all methods.

LSP provides a rich capabilities system, so servers don't need to implement all functionality. However, the protocol.Server interface contains ALL possible methods yet is desirable to use because a jsonrpc2.Handler wrapper is provided which handles repetitive logic like (un)marshaling.

FallbackServer is intended to be embedded within a real server struct implementation, which can then override methods as needed. This is purely for convenience and to make the code easier to browse, as the numerous stub methods are not intermingled with actual functionality.

func (FallbackServer) CodeAction

func (f FallbackServer) CodeAction(_ context.Context,
	_ *protocol.CodeActionParams) (result []protocol.CodeAction, err error)

func (FallbackServer) CodeLens

func (f FallbackServer) CodeLens(_ context.Context,
	_ *protocol.CodeLensParams) (result []protocol.CodeLens, err error)

func (FallbackServer) CodeLensRefresh

func (f FallbackServer) CodeLensRefresh(_ context.Context) (err error)

func (FallbackServer) CodeLensResolve

func (f FallbackServer) CodeLensResolve(_ context.Context,
	_ *protocol.CodeLens) (result *protocol.CodeLens, err error)

func (FallbackServer) ColorPresentation

func (FallbackServer) Completion

func (FallbackServer) CompletionResolve

func (f FallbackServer) CompletionResolve(_ context.Context,
	_ *protocol.CompletionItem) (result *protocol.CompletionItem, err error)

func (FallbackServer) Declaration

func (f FallbackServer) Declaration(_ context.Context,
	_ *protocol.DeclarationParams) (result []protocol.Location, err error)

func (FallbackServer) Definition

func (f FallbackServer) Definition(_ context.Context,
	_ *protocol.DefinitionParams) (result []protocol.Location, err error)

func (FallbackServer) DidChange

func (FallbackServer) DidChangeConfiguration

func (f FallbackServer) DidChangeConfiguration(_ context.Context,
	_ *protocol.DidChangeConfigurationParams) (err error)

func (FallbackServer) DidChangeWatchedFiles

func (f FallbackServer) DidChangeWatchedFiles(_ context.Context,
	_ *protocol.DidChangeWatchedFilesParams) (err error)

func (FallbackServer) DidChangeWorkspaceFolders

func (f FallbackServer) DidChangeWorkspaceFolders(_ context.Context,
	_ *protocol.DidChangeWorkspaceFoldersParams) (err error)

func (FallbackServer) DidClose

func (FallbackServer) DidCreateFiles

func (f FallbackServer) DidCreateFiles(_ context.Context, _ *protocol.CreateFilesParams) (err error)

func (FallbackServer) DidDeleteFiles

func (f FallbackServer) DidDeleteFiles(_ context.Context, _ *protocol.DeleteFilesParams) (err error)

func (FallbackServer) DidOpen

func (FallbackServer) DidRenameFiles

func (f FallbackServer) DidRenameFiles(_ context.Context, _ *protocol.RenameFilesParams) (err error)

func (FallbackServer) DidSave

func (FallbackServer) DocumentColor

func (FallbackServer) DocumentHighlight

func (f FallbackServer) DocumentLink(_ context.Context,
	_ *protocol.DocumentLinkParams) (result []protocol.DocumentLink, err error)

func (FallbackServer) DocumentLinkResolve

func (f FallbackServer) DocumentLinkResolve(_ context.Context,
	_ *protocol.DocumentLink) (result *protocol.DocumentLink, err error)

func (FallbackServer) DocumentSymbol

func (f FallbackServer) DocumentSymbol(_ context.Context,
	_ *protocol.DocumentSymbolParams) (result []interface{}, err error)

func (FallbackServer) ExecuteCommand

func (f FallbackServer) ExecuteCommand(_ context.Context,
	_ *protocol.ExecuteCommandParams) (result interface{}, err error)

func (FallbackServer) Exit

func (f FallbackServer) Exit(_ context.Context) (err error)

func (FallbackServer) FoldingRanges

func (f FallbackServer) FoldingRanges(_ context.Context,
	_ *protocol.FoldingRangeParams) (result []protocol.FoldingRange, err error)

func (FallbackServer) Formatting

func (FallbackServer) Hover

func (f FallbackServer) Hover(_ context.Context,
	_ *protocol.HoverParams) (result *protocol.Hover, err error)

func (FallbackServer) Implementation

func (f FallbackServer) Implementation(_ context.Context,
	_ *protocol.ImplementationParams) (result []protocol.Location, err error)

func (FallbackServer) Initialize

func (FallbackServer) Initialized

func (f FallbackServer) Initialized(_ context.Context, _ *protocol.InitializedParams) (err error)

func (FallbackServer) LinkedEditingRange

func (FallbackServer) LogTrace

func (f FallbackServer) LogTrace(_ context.Context, _ *protocol.LogTraceParams) (err error)

func (FallbackServer) Moniker

func (f FallbackServer) Moniker(_ context.Context,
	_ *protocol.MonikerParams) (result []protocol.Moniker, err error)

func (FallbackServer) OnTypeFormatting

func (f FallbackServer) OnTypeFormatting(_ context.Context,
	_ *protocol.DocumentOnTypeFormattingParams) (result []protocol.TextEdit, err error)

func (FallbackServer) PrepareCallHierarchy

func (f FallbackServer) PrepareCallHierarchy(_ context.Context,
	_ *protocol.CallHierarchyPrepareParams) (result []protocol.CallHierarchyItem, err error)

func (FallbackServer) PrepareRename

func (f FallbackServer) PrepareRename(_ context.Context,
	_ *protocol.PrepareRenameParams) (result *protocol.Range, err error)

func (FallbackServer) RangeFormatting

func (FallbackServer) References

func (f FallbackServer) References(_ context.Context,
	_ *protocol.ReferenceParams) (result []protocol.Location, err error)

func (FallbackServer) Rename

func (FallbackServer) Request

func (f FallbackServer) Request(_ context.Context, _ string,
	_ interface{}) (result interface{}, err error)

func (FallbackServer) SemanticTokensFull

func (f FallbackServer) SemanticTokensFull(_ context.Context,
	_ *protocol.SemanticTokensParams) (result *protocol.SemanticTokens, err error)

func (FallbackServer) SemanticTokensFullDelta

func (f FallbackServer) SemanticTokensFullDelta(_ context.Context,
	_ *protocol.SemanticTokensDeltaParams) (result interface{}, err error)

func (FallbackServer) SemanticTokensRange

func (f FallbackServer) SemanticTokensRange(_ context.Context,
	_ *protocol.SemanticTokensRangeParams) (result *protocol.SemanticTokens, err error)

func (FallbackServer) SemanticTokensRefresh

func (f FallbackServer) SemanticTokensRefresh(_ context.Context) (err error)

func (FallbackServer) SetTrace

func (f FallbackServer) SetTrace(_ context.Context, _ *protocol.SetTraceParams) (err error)

func (FallbackServer) ShowDocument

func (FallbackServer) Shutdown

func (f FallbackServer) Shutdown(_ context.Context) (err error)

func (FallbackServer) SignatureHelp

func (f FallbackServer) SignatureHelp(_ context.Context,
	_ *protocol.SignatureHelpParams) (result *protocol.SignatureHelp, err error)

func (FallbackServer) Symbols

func (FallbackServer) TypeDefinition

func (f FallbackServer) TypeDefinition(_ context.Context,
	_ *protocol.TypeDefinitionParams) (result []protocol.Location, err error)

func (FallbackServer) WillCreateFiles

func (f FallbackServer) WillCreateFiles(_ context.Context,
	_ *protocol.CreateFilesParams) (result *protocol.WorkspaceEdit, err error)

func (FallbackServer) WillDeleteFiles

func (f FallbackServer) WillDeleteFiles(_ context.Context,
	_ *protocol.DeleteFilesParams) (result *protocol.WorkspaceEdit, err error)

func (FallbackServer) WillRenameFiles

func (f FallbackServer) WillRenameFiles(_ context.Context,
	_ *protocol.RenameFilesParams) (result *protocol.WorkspaceEdit, err error)

func (FallbackServer) WillSave

func (FallbackServer) WillSaveWaitUntil

func (f FallbackServer) WillSaveWaitUntil(_ context.Context,
	_ *protocol.WillSaveTextDocumentParams) (result []protocol.TextEdit, err error)

func (FallbackServer) WorkDoneProgressCancel

func (f FallbackServer) WorkDoneProgressCancel(_ context.Context,
	_ *protocol.WorkDoneProgressCancelParams) (err error)

type Server

type Server struct {
	// FallbackServer stubs out protocol.Server, returning "not found" errors
	// for all methods; overridden methods on this object provide real
	// implementations
	FallbackServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cancel context.CancelFunc, notifier protocol.Client, docManager *document.Manager, analyzer *analysis.Analyzer) *Server

func (*Server) Completion

func (s *Server) Completion(ctx context.Context, params *protocol.CompletionParams) (*protocol.CompletionList, error)

func (Server) Definition

func (s Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (result []protocol.Location, err error)

func (*Server) DidChange

func (s *Server) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) (err error)

func (*Server) DidClose

func (s *Server) DidClose(_ context.Context, params *protocol.DidCloseTextDocumentParams) (err error)

func (*Server) DidOpen

func (s *Server) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) (err error)

func (*Server) DidSave

func (s *Server) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) (err error)

func (*Server) DocumentSymbol

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

func (*Server) Exit

func (s *Server) Exit(ctx context.Context) (err error)

func (*Server) Handler

func (s *Server) Handler(middlewares ...middleware.Middleware) jsonrpc2.Handler

func (*Server) Hover

func (s *Server) Hover(ctx context.Context, params *protocol.HoverParams) (result *protocol.Hover, err error)

func (*Server) Initialize

func (s *Server) Initialize(ctx context.Context,
	params *protocol.InitializeParams) (result *protocol.InitializeResult, err error)

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) (err error)

func (*Server) SignatureHelp

func (s *Server) SignatureHelp(ctx context.Context,
	params *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)

Jump to

Keyboard shortcuts

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