js

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package js provides primitives to integrate language server with javascript environments such as browsers and Node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialHost

func DialHost(ctx context.Context) (net.Conn, error)

DialHost registers LSP message listener in JavaScript host and returns connection to use by LSP server.

This function should be called only once before starting LSP server.

Types

type ChannelReader

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

ChannelReader is a reader that reads from a channel of bytes.

func NewChannelReader

func NewChannelReader(source <-chan []byte, cancelFn context.CancelFunc) *ChannelReader

NewChannelReader creates a new ChannelReader from a channel.

Second argument is optional function that will be called when `Close` method is called.

func (*ChannelReader) Close

func (listener *ChannelReader) Close() error

func (*ChannelReader) Read

func (listener *ChannelReader) Read(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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