Documentation
¶
Index ¶
- func ComputeTextEdits(unformatted string, formatted string) []lsp.TextEdit
- func Run(ctx context.Context, stream jsonrpc2.Stream, opts ...interface{}) error
- type LangServer
- func (ls *LangServer) CodeAction(ctx context.Context, params *lsp.CodeActionParams) ([]lsp.CodeAction, error)
- func (ls *LangServer) CodeLens(ctx context.Context, params *lsp.CodeLensParams) ([]lsp.CodeLens, error)
- func (ls *LangServer) CodeLensResolve(ctx context.Context, params *lsp.CodeLens) (*lsp.CodeLens, error)
- func (ls *LangServer) ColorPresentation(ctx context.Context, params *lsp.ColorPresentationParams) ([]lsp.ColorPresentation, error)
- func (ls *LangServer) Completion(ctx context.Context, params *lsp.CompletionParams) (*lsp.CompletionList, error)
- func (ls *LangServer) CompletionResolve(ctx context.Context, params *lsp.CompletionItem) (*lsp.CompletionItem, error)
- func (ls *LangServer) Definition(ctx context.Context, params *lsp.TextDocumentPositionParams) ([]lsp.Location, error)
- func (s *LangServer) Diagnose(ctx context.Context, uri lsp.DocumentURI, text string)
- func (ls *LangServer) DidChange(ctx context.Context, params *lsp.DidChangeTextDocumentParams) error
- func (ls *LangServer) DidChangeConfiguration(ctx context.Context, params *lsp.DidChangeConfigurationParams) error
- func (ls *LangServer) DidChangeWatchedFiles(ctx context.Context, params *lsp.DidChangeWatchedFilesParams) error
- func (ls *LangServer) DidChangeWorkspaceFolders(ctx context.Context, params *lsp.DidChangeWorkspaceFoldersParams) error
- func (ls *LangServer) DidClose(ctx context.Context, params *lsp.DidCloseTextDocumentParams) error
- func (ls *LangServer) DidOpen(ctx context.Context, params *lsp.DidOpenTextDocumentParams) error
- func (ls *LangServer) DidSave(ctx context.Context, params *lsp.DidSaveTextDocumentParams) error
- func (ls *LangServer) DocumentColor(ctx context.Context, params *lsp.DocumentColorParams) ([]lsp.ColorInformation, error)
- func (ls *LangServer) DocumentHighlight(ctx context.Context, params *lsp.TextDocumentPositionParams) ([]lsp.DocumentHighlight, error)
- func (ls *LangServer) DocumentLink(ctx context.Context, params *lsp.DocumentLinkParams) ([]lsp.DocumentLink, error)
- func (ls *LangServer) DocumentLinkResolve(ctx context.Context, params *lsp.DocumentLink) (*lsp.DocumentLink, error)
- func (ls *LangServer) DocumentSymbol(ctx context.Context, params *lsp.DocumentSymbolParams) ([]lsp.DocumentSymbol, error)
- func (ls *LangServer) ExecuteCommand(ctx context.Context, params *lsp.ExecuteCommandParams) (interface{}, error)
- func (ls *LangServer) Exit(ctx context.Context) error
- func (ls *LangServer) FoldingRanges(ctx context.Context, params *lsp.FoldingRangeRequestParam) ([]lsp.FoldingRange, error)
- func (ls *LangServer) Formatting(ctx context.Context, params *lsp.DocumentFormattingParams) ([]lsp.TextEdit, error)
- func (ls *LangServer) Hover(ctx context.Context, params *lsp.TextDocumentPositionParams) (*lsp.Hover, error)
- func (ls *LangServer) Implementation(ctx context.Context, params *lsp.TextDocumentPositionParams) ([]lsp.Location, error)
- func (ls *LangServer) Initialize(ctx context.Context, params *lsp.InitializeParams) (*lsp.InitializeResult, error)
- func (ls *LangServer) Initialized(ctx context.Context, params *lsp.InitializedParams) error
- func (ls *LangServer) OnTypeFormatting(ctx context.Context, params *lsp.DocumentOnTypeFormattingParams) ([]lsp.TextEdit, error)
- func (ls *LangServer) RangeFormatting(ctx context.Context, params *lsp.DocumentRangeFormattingParams) ([]lsp.TextEdit, error)
- func (ls *LangServer) References(ctx context.Context, params *lsp.ReferenceParams) ([]lsp.Location, error)
- func (ls *LangServer) Rename(ctx context.Context, params *lsp.RenameParams) ([]lsp.WorkspaceEdit, error)
- func (ls *LangServer) Shutdown(ctx context.Context) error
- func (ls *LangServer) SignatureHelp(ctx context.Context, params *lsp.TextDocumentPositionParams) (*lsp.SignatureHelp, error)
- func (ls *LangServer) Symbols(ctx context.Context, params *lsp.WorkspaceSymbolParams) ([]lsp.SymbolInformation, error)
- func (ls *LangServer) TypeDefinition(ctx context.Context, params *lsp.TextDocumentPositionParams) ([]lsp.Location, error)
- func (ls *LangServer) WillSave(ctx context.Context, params *lsp.WillSaveTextDocumentParams) error
- func (ls *LangServer) WillSaveWaitUntil(ctx context.Context, params *lsp.WillSaveTextDocumentParams) ([]lsp.TextEdit, error)
- type StdioStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeTextEdits ¶
ComputeTextEdits computes text edits that are required to change the `unformatted` to the `formatted` text. Blatantly stolen from https://github.com/sourcegraph/go-langserver/blob/master/langserver/format.go
Types ¶
type LangServer ¶
type LangServer struct {
// contains filtered or unexported fields
}
func (*LangServer) CodeAction ¶
func (ls *LangServer) CodeAction(ctx context.Context, params *lsp.CodeActionParams) ([]lsp.CodeAction, error)
func (*LangServer) CodeLens ¶
func (ls *LangServer) CodeLens(ctx context.Context, params *lsp.CodeLensParams) ([]lsp.CodeLens, error)
func (*LangServer) CodeLensResolve ¶
func (*LangServer) ColorPresentation ¶
func (ls *LangServer) ColorPresentation(ctx context.Context, params *lsp.ColorPresentationParams) ([]lsp.ColorPresentation, error)
func (*LangServer) Completion ¶
func (ls *LangServer) Completion(ctx context.Context, params *lsp.CompletionParams) (*lsp.CompletionList, error)
func (*LangServer) CompletionResolve ¶
func (ls *LangServer) CompletionResolve(ctx context.Context, params *lsp.CompletionItem) (*lsp.CompletionItem, error)
func (*LangServer) Definition ¶
func (ls *LangServer) Definition(ctx context.Context, params *lsp.TextDocumentPositionParams) ([]lsp.Location, error)
func (*LangServer) Diagnose ¶
func (s *LangServer) Diagnose(ctx context.Context, uri lsp.DocumentURI, text string)
func (*LangServer) DidChange ¶
func (ls *LangServer) DidChange(ctx context.Context, params *lsp.DidChangeTextDocumentParams) error
func (*LangServer) DidChangeConfiguration ¶
func (ls *LangServer) DidChangeConfiguration(ctx context.Context, params *lsp.DidChangeConfigurationParams) error
func (*LangServer) DidChangeWatchedFiles ¶
func (ls *LangServer) DidChangeWatchedFiles(ctx context.Context, params *lsp.DidChangeWatchedFilesParams) error
func (*LangServer) DidChangeWorkspaceFolders ¶
func (ls *LangServer) DidChangeWorkspaceFolders(ctx context.Context, params *lsp.DidChangeWorkspaceFoldersParams) error
func (*LangServer) DidClose ¶
func (ls *LangServer) DidClose(ctx context.Context, params *lsp.DidCloseTextDocumentParams) error
func (*LangServer) DidOpen ¶
func (ls *LangServer) DidOpen(ctx context.Context, params *lsp.DidOpenTextDocumentParams) error
func (*LangServer) DidSave ¶
func (ls *LangServer) DidSave(ctx context.Context, params *lsp.DidSaveTextDocumentParams) error
func (*LangServer) DocumentColor ¶
func (ls *LangServer) DocumentColor(ctx context.Context, params *lsp.DocumentColorParams) ([]lsp.ColorInformation, error)
func (*LangServer) DocumentHighlight ¶
func (ls *LangServer) DocumentHighlight(ctx context.Context, params *lsp.TextDocumentPositionParams) ([]lsp.DocumentHighlight, error)
func (*LangServer) DocumentLink ¶
func (ls *LangServer) DocumentLink(ctx context.Context, params *lsp.DocumentLinkParams) ([]lsp.DocumentLink, error)
func (*LangServer) DocumentLinkResolve ¶
func (ls *LangServer) DocumentLinkResolve(ctx context.Context, params *lsp.DocumentLink) (*lsp.DocumentLink, error)
func (*LangServer) DocumentSymbol ¶
func (ls *LangServer) DocumentSymbol(ctx context.Context, params *lsp.DocumentSymbolParams) ([]lsp.DocumentSymbol, error)
func (*LangServer) ExecuteCommand ¶
func (ls *LangServer) ExecuteCommand(ctx context.Context, params *lsp.ExecuteCommandParams) (interface{}, error)
func (*LangServer) FoldingRanges ¶
func (ls *LangServer) FoldingRanges(ctx context.Context, params *lsp.FoldingRangeRequestParam) ([]lsp.FoldingRange, error)
func (*LangServer) Formatting ¶
func (ls *LangServer) Formatting(ctx context.Context, params *lsp.DocumentFormattingParams) ([]lsp.TextEdit, error)
func (*LangServer) Hover ¶
func (ls *LangServer) Hover(ctx context.Context, params *lsp.TextDocumentPositionParams) (*lsp.Hover, error)
func (*LangServer) Implementation ¶
func (ls *LangServer) Implementation(ctx context.Context, params *lsp.TextDocumentPositionParams) ([]lsp.Location, error)
func (*LangServer) Initialize ¶
func (ls *LangServer) Initialize(ctx context.Context, params *lsp.InitializeParams) (*lsp.InitializeResult, error)
func (*LangServer) Initialized ¶
func (ls *LangServer) Initialized(ctx context.Context, params *lsp.InitializedParams) error
func (*LangServer) OnTypeFormatting ¶
func (ls *LangServer) OnTypeFormatting(ctx context.Context, params *lsp.DocumentOnTypeFormattingParams) ([]lsp.TextEdit, error)
func (*LangServer) RangeFormatting ¶
func (ls *LangServer) RangeFormatting(ctx context.Context, params *lsp.DocumentRangeFormattingParams) ([]lsp.TextEdit, error)
func (*LangServer) References ¶
func (ls *LangServer) References(ctx context.Context, params *lsp.ReferenceParams) ([]lsp.Location, error)
func (*LangServer) Rename ¶
func (ls *LangServer) Rename(ctx context.Context, params *lsp.RenameParams) ([]lsp.WorkspaceEdit, error)
func (*LangServer) SignatureHelp ¶
func (ls *LangServer) SignatureHelp(ctx context.Context, params *lsp.TextDocumentPositionParams) (*lsp.SignatureHelp, error)
func (*LangServer) Symbols ¶
func (ls *LangServer) Symbols(ctx context.Context, params *lsp.WorkspaceSymbolParams) ([]lsp.SymbolInformation, error)
func (*LangServer) TypeDefinition ¶
func (ls *LangServer) TypeDefinition(ctx context.Context, params *lsp.TextDocumentPositionParams) ([]lsp.Location, error)
func (*LangServer) WillSave ¶
func (ls *LangServer) WillSave(ctx context.Context, params *lsp.WillSaveTextDocumentParams) error
func (*LangServer) WillSaveWaitUntil ¶
func (ls *LangServer) WillSaveWaitUntil(ctx context.Context, params *lsp.WillSaveTextDocumentParams) ([]lsp.TextEdit, error)
type StdioStream ¶
type StdioStream struct {
Log bool
// contains filtered or unexported fields
}
func NewStdioStream ¶
func NewStdioStream() *StdioStream
Click to show internal directories.
Click to hide internal directories.