goplsclient

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 19 Imported by: 0

Documentation

Overview

Package goplsclient provides an experimental explicitly configured local gopls session. It supplies observations only; snapshot authority belongs to callers.

Index

Constants

View Source
const MaxDocumentBytes = 256 << 10
View Source
const MaxDocuments = 32
View Source
const MaxMessageBytes = 1 << 20
View Source
const RequestLimit = 20 * time.Second
View Source
const SessionLimit = 10 * time.Minute

Variables

View Source
var ErrProtocol = errors.New("gopls protocol invalid")
View Source
var ErrSession = errors.New("gopls session unavailable")
View Source
var ErrSnapshot = errors.New("snapshot invalid or stale")
View Source
var ErrUnsupported = errors.New("gopls profile unsupported")

Functions

This section is empty.

Types

type Client

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

func Start

func Start(ctx context.Context, config Config) (*Client, error)

func (*Client) Change

func (c *Client) Change(ctx context.Context, uri string) error

func (*Client) CleanupProven

func (c *Client) CleanupProven() bool

CleanupProven is meaningful after Done closes; it does not claim sandbox containment.

func (*Client) CloseDocument

func (c *Client) CloseDocument(ctx context.Context, uri string) error

func (*Client) Definition

func (c *Client) Definition(ctx context.Context, uri string, p Position) ([]Location, error)

func (*Client) Done

func (c *Client) Done() <-chan struct{}

func (*Client) Open

func (c *Client) Open(ctx context.Context, uri string) error

func (*Client) Profile

func (c *Client) Profile() Profile

func (*Client) Shutdown

func (c *Client) Shutdown(ctx context.Context) error

type Config

type Config struct {
	Executable, Root   string
	WorkspaceOnlyGuard bool
	Snapshot           func(string) (Snapshot, bool)
	Current            func(Snapshot) bool
}

type Location

type Location struct {
	Snapshot Snapshot
	Range    Range
}

type Position

type Position struct {
	Line      int `json:"line"`
	Character int `json:"character"`
}

type Profile

type Profile struct {
	ServerVersion, ExecutableSHA256, PositionEncoding string
	LaunchEnvironmentSHA256                           string
	WorkspaceOnlyGuard                                bool
	ExternalInputsPinned                              bool
	Definition                                        bool
}

type Range

type Range struct {
	Start Position `json:"start"`
	End   Position `json:"end"`
}

type Snapshot

type Snapshot struct {
	URI, Identity, Text string
	Version             int
	Overlay             bool
}

Snapshot is opaque caller identity and content, never inferred from disk. Identity must change across reopen/reset even for equal version and text. Callbacks must be concurrent-safe, bounded and side-effect free.

Jump to

Keyboard shortcuts

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