Documentation ¶
Overview ¶
Package lsp implements LSP for gopls.
Index ¶
- Variables
- type Server
- func (s *Server) CodeAction(context.Context, *protocol.CodeActionParams) ([]protocol.CodeAction, error)
- func (s *Server) CodeLens(context.Context, *protocol.CodeLensParams) ([]protocol.CodeLens, error)
- func (s *Server) ColorPresentation(context.Context, *protocol.ColorPresentationParams) ([]protocol.ColorPresentation, error)
- func (s *Server) Completion(context.Context, *protocol.CompletionParams) (*protocol.CompletionList, error)
- func (s *Server) Declaration(context.Context, *protocol.DeclarationParams) (protocol.Declaration, error)
- func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (protocol.Definition, error)
- func (s *Server) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) error
- func (s *Server) DidChangeConfiguration(context.Context, *protocol.DidChangeConfigurationParams) error
- func (s *Server) DidChangeWatchedFiles(context.Context, *protocol.DidChangeWatchedFilesParams) error
- func (s *Server) DidChangeWorkspaceFolders(context.Context, *protocol.DidChangeWorkspaceFoldersParams) error
- func (s *Server) DidClose(ctx context.Context, params *protocol.DidCloseTextDocumentParams) error
- func (s *Server) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) error
- func (s *Server) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) error
- func (s *Server) DocumentColor(context.Context, *protocol.DocumentColorParams) ([]protocol.ColorInformation, error)
- func (s *Server) DocumentHighlight(context.Context, *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
- func (s *Server) DocumentLink(context.Context, *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)
- func (s *Server) DocumentSymbol(context.Context, *protocol.DocumentSymbolParams) ([]interface{}, error)
- func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (interface{}, error)
- func (s *Server) Exit(ctx context.Context) error
- func (s *Server) FoldingRange(context.Context, *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)
- func (s *Server) Formatting(context.Context, *protocol.DocumentFormattingParams) ([]protocol.TextEdit, error)
- func (s *Server) Hover(ctx context.Context, params *protocol.HoverParams) (*protocol.Hover, error)
- func (s *Server) Implementation(context.Context, *protocol.ImplementationParams) (protocol.Definition, error)
- func (s *Server) IncomingCalls(context.Context, *protocol.CallHierarchyIncomingCallsParams) ([]protocol.CallHierarchyIncomingCall, error)
- func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error)
- func (s *Server) Initialized(ctx context.Context, params *protocol.InitializedParams) error
- func (s *Server) LogTraceNotification(context.Context, *protocol.LogTraceParams) error
- func (s *Server) NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error)
- func (s *Server) OnTypeFormatting(context.Context, *protocol.DocumentOnTypeFormattingParams) ([]protocol.TextEdit, error)
- func (s *Server) OutgoingCalls(context.Context, *protocol.CallHierarchyOutgoingCallsParams) ([]protocol.CallHierarchyOutgoingCall, error)
- func (s *Server) PrepareCallHierarchy(context.Context, *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)
- func (s *Server) PrepareRename(context.Context, *protocol.PrepareRenameParams) (*protocol.Range, error)
- func (s *Server) Progress(context.Context, *protocol.ProgressParams) error
- func (s *Server) RangeFormatting(context.Context, *protocol.DocumentRangeFormattingParams) ([]protocol.TextEdit, error)
- func (s *Server) References(context.Context, *protocol.ReferenceParams) ([]protocol.Location, error)
- func (s *Server) Rename(context.Context, *protocol.RenameParams) (*protocol.WorkspaceEdit, error)
- func (s *Server) Resolve(context.Context, *protocol.CompletionItem) (*protocol.CompletionItem, error)
- func (s *Server) ResolveCodeLens(context.Context, *protocol.CodeLens) (*protocol.CodeLens, error)
- func (s *Server) ResolveDocumentLink(context.Context, *protocol.DocumentLink) (*protocol.DocumentLink, error)
- func (s *Server) SelectionRange(context.Context, *protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)
- func (s *Server) SemanticTokens(context.Context, *protocol.SemanticTokensParams) (*protocol.SemanticTokens, error)
- func (s *Server) SemanticTokensEdits(context.Context, *protocol.SemanticTokensEditsParams) (interface{}, error)
- func (s *Server) SemanticTokensRange(context.Context, *protocol.SemanticTokensRangeParams) (*protocol.SemanticTokens, error)
- func (s *Server) SetTraceNotification(context.Context, *protocol.SetTraceParams) error
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) SignatureHelp(context.Context, *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)
- func (s *Server) Symbol(context.Context, *protocol.WorkspaceSymbolParams) ([]protocol.SymbolInformation, error)
- func (s *Server) TypeDefinition(context.Context, *protocol.TypeDefinitionParams) (protocol.Definition, error)
- func (s *Server) WillSave(context.Context, *protocol.WillSaveTextDocumentParams) error
- func (s *Server) WillSaveWaitUntil(context.Context, *protocol.WillSaveTextDocumentParams) ([]protocol.TextEdit, error)
- func (s *Server) WorkDoneProgressCancel(context.Context, *protocol.WorkDoneProgressCancelParams) error
- func (s *Server) WorkDoneProgressCreate(context.Context, *protocol.WorkDoneProgressCreateParams) error
- type SyslErrorListener
- func (l *SyslErrorListener) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ...)
- func (l *SyslErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, ...)
- func (l *SyslErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, ...)
- func (l *SyslErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, ...)
Constants ¶
This section is empty.
Variables ¶
View Source
var ServerExitFunc = os.Exit
ServerExitFunc is used to exit when requested by the client. It is mutable for testing purposes.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements the protocol.Server interface.
func NewServer ¶
NewServer creates an LSP server and binds it to handle incoming client messages on on the supplied stream.
func (*Server) CodeAction ¶
func (s *Server) CodeAction(context.Context, *protocol.CodeActionParams) ([]protocol.CodeAction, error)
func (*Server) ColorPresentation ¶
func (s *Server) ColorPresentation(context.Context, *protocol.ColorPresentationParams) ([]protocol.ColorPresentation, error)
func (*Server) Completion ¶
func (s *Server) Completion(context.Context, *protocol.CompletionParams) (*protocol.CompletionList, error)
func (*Server) Declaration ¶
func (s *Server) Declaration(context.Context, *protocol.DeclarationParams) (protocol.Declaration, error)
func (*Server) Definition ¶
func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (protocol.Definition, error)
func (*Server) DidChangeConfiguration ¶
func (*Server) DidChangeWatchedFiles ¶
func (*Server) DidChangeWorkspaceFolders ¶
func (*Server) DocumentColor ¶
func (s *Server) DocumentColor(context.Context, *protocol.DocumentColorParams) ([]protocol.ColorInformation, error)
func (*Server) DocumentHighlight ¶
func (s *Server) DocumentHighlight(context.Context, *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
func (*Server) DocumentLink ¶
func (s *Server) DocumentLink(context.Context, *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)
func (*Server) DocumentSymbol ¶
func (*Server) ExecuteCommand ¶
func (*Server) FoldingRange ¶
func (s *Server) FoldingRange(context.Context, *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)
func (*Server) Formatting ¶
func (*Server) Implementation ¶
func (s *Server) Implementation(context.Context, *protocol.ImplementationParams) (protocol.Definition, error)
func (*Server) IncomingCalls ¶
func (s *Server) IncomingCalls(context.Context, *protocol.CallHierarchyIncomingCallsParams) ([]protocol.CallHierarchyIncomingCall, error)
func (*Server) Initialize ¶
func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error)
func (*Server) Initialized ¶
func (*Server) LogTraceNotification ¶
func (*Server) NonstandardRequest ¶
func (*Server) OnTypeFormatting ¶
func (*Server) OutgoingCalls ¶
func (s *Server) OutgoingCalls(context.Context, *protocol.CallHierarchyOutgoingCallsParams) ([]protocol.CallHierarchyOutgoingCall, error)
func (*Server) PrepareCallHierarchy ¶
func (s *Server) PrepareCallHierarchy(context.Context, *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)
func (*Server) PrepareRename ¶
func (*Server) RangeFormatting ¶
func (*Server) References ¶
func (*Server) Rename ¶
func (s *Server) Rename(context.Context, *protocol.RenameParams) (*protocol.WorkspaceEdit, error)
func (*Server) Resolve ¶
func (s *Server) Resolve(context.Context, *protocol.CompletionItem) (*protocol.CompletionItem, error)
func (*Server) ResolveCodeLens ¶
func (*Server) ResolveDocumentLink ¶
func (s *Server) ResolveDocumentLink(context.Context, *protocol.DocumentLink) (*protocol.DocumentLink, error)
func (*Server) SelectionRange ¶
func (s *Server) SelectionRange(context.Context, *protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)
func (*Server) SemanticTokens ¶
func (s *Server) SemanticTokens(context.Context, *protocol.SemanticTokensParams) (*protocol.SemanticTokens, error)
func (*Server) SemanticTokensEdits ¶
func (*Server) SemanticTokensRange ¶
func (s *Server) SemanticTokensRange(context.Context, *protocol.SemanticTokensRangeParams) (*protocol.SemanticTokens, error)
func (*Server) SetTraceNotification ¶
func (*Server) SignatureHelp ¶
func (s *Server) SignatureHelp(context.Context, *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)
func (*Server) Symbol ¶
func (s *Server) Symbol(context.Context, *protocol.WorkspaceSymbolParams) ([]protocol.SymbolInformation, error)
func (*Server) TypeDefinition ¶
func (s *Server) TypeDefinition(context.Context, *protocol.TypeDefinitionParams) (protocol.Definition, error)
func (*Server) WillSaveWaitUntil ¶
func (*Server) WorkDoneProgressCancel ¶
func (*Server) WorkDoneProgressCreate ¶
type SyslErrorListener ¶
type SyslErrorListener struct { antlr.ErrorListener Errors []protocol.Diagnostic // contains filtered or unexported fields }
func NewSyslErrorListener ¶
func NewSyslErrorListener(ctx context.Context, client protocol.Client) *SyslErrorListener
func (*SyslErrorListener) ReportAmbiguity ¶
func (*SyslErrorListener) ReportAttemptingFullContext ¶
func (l *SyslErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs antlr.ATNConfigSet)
func (*SyslErrorListener) ReportContextSensitivity ¶
func (l *SyslErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs antlr.ATNConfigSet)
func (*SyslErrorListener) SyntaxError ¶
func (l *SyslErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
lspframework
|
|
jsonrpc2
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
|
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec. |
jsonrpc2/servertest
Package servertest provides utilities for running tests against a remote LSP server.
|
Package servertest provides utilities for running tests against a remote LSP server. |
lsp/debug
Package debug exports debug information for gopls.
|
Package debug exports debug information for gopls. |
lsp/helper
Invoke with //go:generate helper/helper -t Server -d protocol/tsserver.go -u lsp -o server_gen.go invoke in lspframework/lsp
|
Invoke with //go:generate helper/helper -t Server -d protocol/tsserver.go -u lsp -o server_gen.go invoke in lspframework/lsp |
lsp/protocol
Package protocol contains the structs that map directly to the wire format of the "Language Server Protocol".
|
Package protocol contains the structs that map directly to the wire format of the "Language Server Protocol". |
lsp/telemetry
Package telemetry provides the hooks and adapters to allow use of telemetry throughout gopls.
|
Package telemetry provides the hooks and adapters to allow use of telemetry throughout gopls. |
span
Package span contains support for representing with positions and ranges in text files.
|
Package span contains support for representing with positions and ranges in text files. |
telemetry
Package telemetry provides an opinionated set of packages that cover the main concepts of telemetry in an implementation agnostic way.
|
Package telemetry provides an opinionated set of packages that cover the main concepts of telemetry in an implementation agnostic way. |
telemetry/export
Package export holds the definition of the telemetry Exporter interface, along with some simple implementations.
|
Package export holds the definition of the telemetry Exporter interface, along with some simple implementations. |
telemetry/export/ocagent
Package ocagent adds the ability to export all telemetry to an ocagent.
|
Package ocagent adds the ability to export all telemetry to an ocagent. |
telemetry/log
Package log is a context based logging package, designed to interact well with both the lsp protocol and the other telemetry packages.
|
Package log is a context based logging package, designed to interact well with both the lsp protocol and the other telemetry packages. |
telemetry/metric
Package metric aggregates stats into metrics that can be exported.
|
Package metric aggregates stats into metrics that can be exported. |
telemetry/stats
Package stats provides support for recording telemetry statistics.
|
Package stats provides support for recording telemetry statistics. |
telemetry/tag
Package tag provides support for telemetry tagging.
|
Package tag provides support for telemetry tagging. |
telemetry/trace
Package trace adds support for telemetry tracing.
|
Package trace adds support for telemetry tracing. |
telemetry/unit
Package unit holds the definitions for the units you can use in telemetry.
|
Package unit holds the definitions for the units you can use in telemetry. |
xcontext
Package xcontext is a package to offer the extra functionality we need from contexts that is not available from the standard context package.
|
Package xcontext is a package to offer the extra functionality we need from contexts that is not available from the standard context package. |
Package lsprpc implements a jsonrpc2.StreamServer that may be used to serve the LSP on a jsonrpc2 channel.
|
Package lsprpc implements a jsonrpc2.StreamServer that may be used to serve the LSP on a jsonrpc2 channel. |
Click to show internal directories.
Click to hide internal directories.