Back to godoc.org

Package lsp

v0.0.0-...-f5e916c
Latest Go to latest

The latest major version is .

Published: 1 hour ago | License: BSD-3-Clause | Module: golang.org/x/tools

Overview

Package lsp implements LSP for gopls.

Index

Constants

const (
	// FromDidOpen is a file modification caused by opening a file.
	FromDidOpen = ModificationSource(iota)

	// FromDidChange is a file modification caused by changing a file.
	FromDidChange

	// FromDidChangeWatchedFiles is a file modification caused by a change to a
	// watched file.
	FromDidChangeWatchedFiles

	// FromDidSave is a file modification caused by a file save.
	FromDidSave

	// FromDidClose is a file modification caused by closing a file.
	FromDidClose

	// FromRegenerateCgo refers to file modifications caused by regenerating
	// the cgo sources for the workspace.
	FromRegenerateCgo

	// FromInitialWorkspaceLoad refers to the loading of all packages in the
	// workspace when the view is first created.
	FromInitialWorkspaceLoad
)

func DiagnosticWorkTitle

func DiagnosticWorkTitle(cause ModificationSource) string

DiagnosticWorkTitle returns the title of the diagnostic work resulting from a file change originating from the given cause.

type ModificationSource

type ModificationSource int

ModificationSource identifies the originating cause of a file modification.

func (ModificationSource) String

func (m ModificationSource) String() string

type Server

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

Server implements the protocol.Server interface.

func NewServer

func NewServer(session source.Session, client protocol.Client) *Server

NewServer creates an LSP server and binds it to handle incoming client messages on on the supplied stream.

func (*Server) CodeAction

func (s *Server) CodeAction(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error)

func (*Server) CodeLens

func (s *Server) CodeLens(ctx context.Context, params *protocol.CodeLensParams) ([]protocol.CodeLens, error)

func (*Server) Completion

func (s *Server) Completion(ctx context.Context, params *protocol.CompletionParams) (*protocol.CompletionList, error)

func (*Server) Definition

func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (protocol.Definition, error)

func (*Server) DidChange

func (s *Server) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) error

func (*Server) DidChangeConfiguration

func (s *Server) DidChangeConfiguration(ctx context.Context, changed *protocol.DidChangeConfigurationParams) error

func (*Server) DidChangeWatchedFiles

func (s *Server) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) error

func (*Server) DidChangeWorkspaceFolders

func (s *Server) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error

func (*Server) DidClose

func (s *Server) DidClose(ctx context.Context, params *protocol.DidCloseTextDocumentParams) error

func (*Server) DidOpen

func (s *Server) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) error

func (*Server) DidSave

func (s *Server) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) error

func (*Server) DocumentHighlight

func (s *Server) DocumentHighlight(ctx context.Context, params *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
func (s *Server) DocumentLink(ctx context.Context, params *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)

func (*Server) DocumentSymbol

func (s *Server) DocumentSymbol(ctx context.Context, params *protocol.DocumentSymbolParams) ([]interface{}, error)

func (*Server) ExecuteCommand

func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (interface{}, error)

func (*Server) Exit

func (s *Server) Exit(ctx context.Context) error

func (*Server) FoldingRange

func (s *Server) FoldingRange(ctx context.Context, params *protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)

func (*Server) Formatting

func (s *Server) Formatting(ctx context.Context, params *protocol.DocumentFormattingParams) ([]protocol.TextEdit, error)

func (*Server) Hover

func (s *Server) Hover(ctx context.Context, params *protocol.HoverParams) (*protocol.Hover, error)

func (*Server) Implementation

func (s *Server) Implementation(ctx context.Context, params *protocol.ImplementationParams) (protocol.Definition, error)

func (*Server) Initialize

func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error)

func (*Server) Initialized

func (s *Server) Initialized(ctx context.Context, params *protocol.InitializedParams) error

func (*Server) LogTrace

func (s *Server) LogTrace(context.Context, *protocol.LogTraceParams) error

func (*Server) NonstandardRequest

func (s *Server) NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error)

func (*Server) PrepareCallHierarchy

func (s *Server) PrepareCallHierarchy(ctx context.Context, params *protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)

func (*Server) PrepareRename

func (s *Server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.Range, error)

func (*Server) References

func (s *Server) References(ctx context.Context, params *protocol.ReferenceParams) ([]protocol.Location, error)

func (*Server) Rename

func (s *Server) Rename(ctx context.Context, params *protocol.RenameParams) (*protocol.WorkspaceEdit, error)

func (*Server) ResolveCodeLens

func (s *Server) ResolveCodeLens(context.Context, *protocol.CodeLens) (*protocol.CodeLens, error)
func (s *Server) ResolveDocumentLink(context.Context, *protocol.DocumentLink) (*protocol.DocumentLink, error)

func (*Server) SemanticTokensFullDelta

func (s *Server) SemanticTokensFullDelta(context.Context, *protocol.SemanticTokensDeltaParams) (interface{}, error)

func (*Server) SemanticTokensRefresh

func (s *Server) SemanticTokensRefresh(context.Context) error

func (*Server) SetTrace

func (s *Server) SetTrace(context.Context, *protocol.SetTraceParams) error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) SignatureHelp

func (s *Server) SignatureHelp(ctx context.Context, params *protocol.SignatureHelpParams) (*protocol.SignatureHelp, error)

func (*Server) Symbol

func (s *Server) Symbol(ctx context.Context, params *protocol.WorkspaceSymbolParams) ([]protocol.SymbolInformation, error)

func (*Server) TypeDefinition

func (s *Server) TypeDefinition(ctx context.Context, params *protocol.TypeDefinitionParams) (protocol.Definition, error)

func (*Server) WorkDoneProgressCancel

func (s *Server) WorkDoneProgressCancel(ctx context.Context, params *protocol.WorkDoneProgressCancelParams) error

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier