server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandSubmitTransaction     = "cadence.server.submitTransaction"
	CommandExecuteScript         = "cadence.server.executeScript"
	CommandUpdateAccountCode     = "cadence.server.updateAccountCode"
	CommandCreateAccount         = "cadence.server.createAccount"
	CommandCreateDefaultAccounts = "cadence.server.createDefaultAccounts"
	CommandSwitchActiveAccount   = "cadence.server.switchActiveAccount"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHandler

type CommandHandler func(conn protocol.Conn, args ...interface{}) (interface{}, error)

CommandHandler represents the form of functions that handle commands submitted from the client using workspace/executeCommand.

type Server

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

func NewServer

func NewServer() *Server

func (*Server) CodeLens

func (s *Server) CodeLens(conn protocol.Conn, params *protocol.CodeLensParams) ([]*protocol.CodeLens, error)

CodeLens is called every time the document contents change and returns a list of actions to be injected into the source as inline buttons.

func (*Server) Definition

func (s *Server) Definition(
	_ protocol.Conn,
	params *protocol.TextDocumentPositionParams,
) (*protocol.Location, error)

Definition finds the definition of the type at the given location.

func (*Server) DidChangeTextDocument

func (s *Server) DidChangeTextDocument(
	conn protocol.Conn,
	params *protocol.DidChangeTextDocumentParams,
) error

DidChangeTextDocument is called whenever the current document changes. We parse and check the text and publish diagnostics about the document.

func (*Server) DidOpenTextDocument

func (s *Server) DidOpenTextDocument(conn protocol.Conn, params *protocol.DidOpenTextDocumentParams) error

DidOpenTextDocument is called whenever a new file is opened. We parse and check the text and publish diagnostics about the document.

func (*Server) ExecuteCommand

func (s *Server) ExecuteCommand(conn protocol.Conn, params *protocol.ExecuteCommandParams) (interface{}, error)

ExecuteCommand is called to execute a custom, server-defined command.

We register all the commands we support in registerCommands and populate their corresponding handler at server initialization.

func (*Server) Exit

func (*Server) Exit(_ protocol.Conn) error

Exit exits the process.

func (*Server) Hover

Hover returns contextual type information about the variable at the given location.

func (*Server) Initialize

func (s *Server) Initialize(
	conn protocol.Conn,
	params *protocol.InitializeParams,
) (
	*protocol.InitializeResult,
	error,
)

func (*Server) Shutdown

func (*Server) Shutdown(conn protocol.Conn) error

Shutdown tells the server to stop accepting any new requests. This can only be followed by a call to Exit, which exits the process.

func (*Server) SignatureHelp

TODO

func (*Server) Start

func (s *Server) Start()

Jump to

Keyboard shortcuts

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