Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeTextEdits(unformatted string, formatted string) []lsp.TextEdit
- func Run(ctx context.Context, stream jsonrpc2.Stream, opts ...interface{}) error
- type Cache
- type FormatSettings
- 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)
- 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 (s *LangServer) Format(params *lsp.DocumentFormattingParams) ([]lsp.TextEdit, 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 LengthCheckSettings
- type Settings
- type StdioStream
- type YololSettings
Constants ¶
const ( FormatModeCompact = "Compact" FormatModeReadale = "Readable" LengthCheckModeStrict = "Strict" LengthCheckModeOptimize = "Optimize" LengthCheckModeOff = "Off" )
Variables ¶
var NotFoundError = fmt.Errorf("File not found in cache")
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 Cache ¶ added in v0.0.7
type Cache struct {
Files map[lsp.DocumentURI]string
Lock *sync.Mutex
}
type FormatSettings ¶ added in v0.0.14
type FormatSettings struct {
Mode string `json:"mode"`
}
FormatSettings contains formatting settings
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)
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) Format ¶ added in v0.0.7
func (s *LangServer) Format(params *lsp.DocumentFormattingParams) ([]lsp.TextEdit, error)
Format computes formatting instructions for the given document. Parser errors during formatting are silently discared, as reporting them to the user would just be annoying and showing errors is already done by the diagnostics
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 LengthCheckSettings ¶ added in v0.0.18
type LengthCheckSettings struct {
Mode string `json:"mode"`
}
LengthCheckSettings contains settings for the lenght-validation
type Settings ¶ added in v0.0.14
type Settings struct {
Yolol YololSettings `json:"yolol"`
}
Settings contains settings for the language-server
func DefaultSettings ¶ added in v0.0.14
func DefaultSettings() *Settings
DefaultSettings returns the default-settings for the server
type StdioStream ¶
type StdioStream struct {
Log bool
// contains filtered or unexported fields
}
func NewStdioStream ¶
func NewStdioStream() *StdioStream
type YololSettings ¶ added in v0.0.14
type YololSettings struct {
Formatting FormatSettings `json:"formatting"`
LengthChecking LengthCheckSettings `json:"lengthChecking"`
}
YololSettings contains settings specific to yolol