Documentation ¶
Index ¶
- func Run(ctx context.Context, cfg RunConfig) (err error)
- type Conn
- type DocumentSymbol
- type GoplsClient
- func (c *GoplsClient) Call(ctx context.Context, method string, params, result interface{}) error
- func (c *GoplsClient) Close() error
- func (s *GoplsClient) DocumentReferences(ctx context.Context, loc lsp.Location) ([]*lsp.Location, error)
- func (s *GoplsClient) DocumentSymbol(ctx context.Context, filename string) ([]*Symbol, error)
- func (s *GoplsClient) Initialize(ctx context.Context, params *lsp.InitializeParams) (*lsp.InitializeResult, error)
- func (s *GoplsClient) Initialized(ctx context.Context) error
- func (c *GoplsClient) Read(ctx context.Context, candidate uint64, respChan chan<- response) error
- func (c *GoplsClient) Write(r request) error
- type InitializedParams
- type RunConfig
- type Symbol
- type SymbolTag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn struct { io.ReadCloser io.WriteCloser // contains filtered or unexported fields }
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 (*GoplsClient) DocumentSymbol ¶
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
Click to show internal directories.
Click to hide internal directories.