langserver

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: Apache-2.0, BSD-3-Clause Imports: 31 Imported by: 0

Documentation

Overview

nolint: lll

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONLogStream

func JSONLogStream(str jsonrpc2.Stream, w io.Writer) jsonrpc2.Stream

JSONLogStream returns a stream that does log all communications in a format that can be streamed into the lsp inspector

func RunTCPServers

func RunTCPServers(ctx context.Context, addr string, config *Config) error

TCPServer generates a Server listening on the provided TCP Address, creating a new language Server instance for every connection

func WebSocketHandler

func WebSocketHandler(addr string) (func(http.ResponseWriter, *http.Request), error)

Types

type Config

type Config struct {
	RPCTrace      string `yaml:"rpc_trace"`
	PrometheusURL string `yaml:"prometheus_url"`
}

Config contains the configuration for a server

func ParseConfig

func ParseConfig(in []byte) (*Config, error)

ParseConfig parses a yaml configuration.

It expects the content of the configuration file as its argument

func ParseConfigFile

func ParseConfigFile(path string) (*Config, error)

ParseConfigFile parses a yaml configuration file.

It expects the path to a configuration file as its argument

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server wraps language server instance that can connect to exactly one client

func ServerFromStream

func ServerFromStream(ctx context.Context, stream jsonrpc2.Stream, config *Config) (context.Context, Server)

ServerFromStream generates a Server from a jsonrpc2.Stream

func StdioServer

func StdioServer(ctx context.Context, config *Config) (context.Context, Server)

StdioServer generates a Server talking to stdio

func (Server) Run

func (s Server) Run() error

Run starts the language server instance

Directories

Path Synopsis
nolint:lll
nolint:lll
documentation

Jump to

Keyboard shortcuts

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