Documentation
¶
Overview ¶
Package agent implements read-only language-tooling requests against gopls.
Index ¶
Constants ¶
const MaxBatchOperations = 16
MaxBatchOperations bounds prepared source overlays retained by one session.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Result ¶
type Result struct {
Operation string `json:"operation"`
Workspace string `json:"workspace"`
File string `json:"file"`
Position Position `json:"position"`
Server ServerInfo `json:"server"`
Payload json.RawMessage `json:"result"`
Timing Timing `json:"timing"`
}
func Inspect ¶
Inspect launches an existing gopls executable, sends one unsaved document and returns its actual response. No source files or source-file probes are written.
func InspectBatch ¶
InspectBatch owns one fresh language-server session for a related scenario. Each operation opens its independently prepared overlay and closes it before the next operation. Initialization and each operation have separate deadlines; any failure stops the batch and closes the owned process. Returned results are the completed prefix; callers must still check the error, including cleanup. No server or unsaved state is shared between calls.
type ServerInfo ¶
type Timing ¶
type Timing struct {
InitializeNanoseconds int64 `json:"initialize_ns"`
RequestNanoseconds int64 `json:"request_ns"`
}
Timing separates protocol request latency from server startup. Request time includes any gopls package loading caused by that request; it is not CPU time. Process shutdown and document preparation belong to the caller's wall time.