langserver

package
v13.2.0-beta3+incompat... Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureURL

func EnsureURL(uri lsp.DocumentURI, pathType string) (url lsp.DocumentURI, err error)

EnsureURL ensures that the documentURI is a valid path in the filesystem and a valid 'file://' URI

func GetPathFromURL

func GetPathFromURL(uri lsp.DocumentURI, pathType string) (documentPath string, err error)

GetPathFromURL returns the absolute path of the file which documenURI relates to it also checks if the file path is valid

func IsURL

func IsURL(uri lsp.DocumentURI) bool

IsURL checks if the documentUri passed has 'file://' prefix

func NewHandler

func NewHandler() jsonrpc2.Handler

NewHandler creates a BUILD file language server handler

func ReadFile

func ReadFile(ctx context.Context, uri lsp.DocumentURI) ([]string, error)

ReadFile takes a DocumentURI and reads the file into a slice of string

Types

type LsHandler

type LsHandler struct {
	IsServerDown bool
	// contains filtered or unexported fields
}

LsHandler is the main handler struct of the language server handler

func (*LsHandler) Handle

func (h *LsHandler) Handle(ctx context.Context, conn *jsonrpc2.Conn, request *jsonrpc2.Request) (result interface{}, err error)

Handle function takes care of all the incoming from the client, and returns the correct response

Jump to

Keyboard shortcuts

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