MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / _read_message

Function _read_message

benches/memory_usage.py:127–137  ·  view source on GitHub ↗

Read one JSON-RPC message from the LSP stdout.

(stream)

Source from the content-addressed store, hash-verified

125
126
127def _read_message(stream) -> dict[str, Any]:
128 """Read one JSON-RPC message from the LSP stdout."""
129 headers = _read_headers(stream)
130 length = int(headers["content-length"])
131 body = b""
132 while len(body) < length:
133 chunk = stream.read(length - len(body))
134 if not chunk:
135 raise EOFError("LSP process closed stdout")
136 body += chunk
137 return json.loads(body)
138
139
140# ── LspClient ────────────────────────────────────────────────────────────────

Callers 1

_reader_loopMethod · 0.85

Calls 1

_read_headersFunction · 0.85

Tested by

no test coverage detected