MCPcopy
hub / github.com/docker/docker-agent / lspSession

Struct lspSession

pkg/tools/builtin/lsp/lsp_lifecycle.go:215–226  ·  view source on GitHub ↗

lspSession is a single live LSP server session. cmd.Wait must be called exactly once per *exec.Cmd; both Wait and Close can race to be the caller. A shared sync.Once runs the wait body in one goroutine and exposes the result via the pre-allocated waitDone channel; both Wait and Close block on waitDo

Source from the content-addressed store, hash-verified

213// exposes the result via the pre-allocated waitDone channel; both Wait
214// and Close block on waitDone to observe the process exit.
215type lspSession struct {
216 h *lspHandler
217 processCancel context.CancelFunc
218 stdin io.WriteCloser
219 cmd *exec.Cmd // captured at construction; never nilled by handler teardown.
220
221 closed atomic.Bool
222
223 waitOnce sync.Once
224 waitErr error
225 waitDone chan struct{} // pre-allocated in Connect; closed by the wait goroutine.
226}
227
228// Wait blocks until the LSP process exits. Safe to call concurrently with
229// Close.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected