lib

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg RunConfig) (err error)

Types

type Conn

type Conn struct {
	io.ReadCloser
	io.WriteCloser
	// contains filtered or unexported fields
}

func (Conn) Close

func (c Conn) Close() error

Close closes conn's WriteCloser ReadClosers.

func (Conn) Start

func (c Conn) Start() error

Start starts conn's Cmd.

type DocumentSymbol

type DocumentSymbol struct {
	/**
	 * The name of this symbol. Will be displayed in the user interface and therefore must not be
	 * an empty string or a string only consisting of white spaces.
	 */
	Name string `json:"name"`
	/**
	 * More detail for this symbol, e.g the signature of a function.
	 */
	Detail string `json:"detail,omitempty"`
	/**
	 * The kind of this symbol.
	 */
	Kind lsp.SymbolKind `json:"kind"`
	/**
	 * Tags for this document symbol.
	 *
	 * @since 3.16.0
	 */
	Tags []SymbolTag `json:"tags,omitempty"`
	/**
	 * Indicates if this symbol is deprecated.
	 *
	 * @deprecated Use tags instead
	 */
	Deprecated bool `json:"deprecated,omitempty"`
	/**
	 * The range enclosing this symbol not including leading/trailing whitespace but everything else
	 * like comments. This information is typically used to determine if the the clients cursor is
	 * inside the symbol to reveal in the symbol in the UI.
	 */
	Range lsp.Range `json:"range"`
	/**
	 * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
	 * Must be contained by the the `range`.
	 */
	SelectionRange lsp.Range `json:"selectionRange"`
	/**
	 * Children of this symbol, e.g. properties of a class.
	 */
	Children []DocumentSymbol `json:"children,omitempty"`
}

*

  • Represents programming constructs like variables, classes, interfaces etc.
  • that appear in a document. Document symbols can be hierarchical and they
  • have two ranges: one that encloses its definition and one that points to
  • its most interesting range, e.g. the range of an identifier.

type GoplsClient

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

func (*GoplsClient) Call

func (c *GoplsClient) Call(ctx context.Context, method string, params, result interface{}) error

Call calls the gopls method with the params given. If result is non-nil, the response body is unmarshalled into it.

func (*GoplsClient) Close

func (c *GoplsClient) Close() error

func (*GoplsClient) DocumentReferences

func (s *GoplsClient) DocumentReferences(ctx context.Context, loc lsp.Location) ([]*lsp.Location, error)

func (*GoplsClient) DocumentSymbol

func (s *GoplsClient) DocumentSymbol(ctx context.Context, filename string) ([]*Symbol, error)

func (*GoplsClient) Initialize

func (s *GoplsClient) Initialize(ctx context.Context, params *lsp.InitializeParams) (*lsp.InitializeResult, error)

func (*GoplsClient) Initialized

func (s *GoplsClient) Initialized(ctx context.Context) error

func (*GoplsClient) Read

func (c *GoplsClient) Read(ctx context.Context, candidate uint64, respChan chan<- response) error

Read reads from gopls until candidate is found and sent on respChan.

func (*GoplsClient) Write

func (c *GoplsClient) Write(r request) error

Write writes a request to gopls using the format specified by: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md#text-documents

type InitializedParams

type InitializedParams struct{}

Types missing in github.com/sourcegraph/go-lsp borrowed from https://github.com/golang/tools/tree/master/gopls TODO(bep) consolidate with lsp/lsp.go

type RunConfig

type RunConfig struct {
	WorkspaceDir    string
	FilenamePattern string
	Out             io.Writer
}

type Symbol

type Symbol struct {
	Name     string
	Kind     lsp.SymbolKind
	Location lsp.Location
	Children []*Symbol
}

type SymbolTag

type SymbolTag float64

Directories

Path Synopsis
testpackages

Jump to

Keyboard shortcuts

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