Skip to main content

Module buffer_names

Module buffer_names 

Source
Expand description

Canonical synthetic buffer names for the LSP log family.

Three flavours of LSP-owned Document buffer, one canonical name format each:

  • *lsp* — subsystem-wide log. Captures every record with server_id.is_none() (lifecycle, attach driver, supervisor chatter). LSP_SUBSYSTEM_LOG_NAME.
  • *lsp:<server>:<workspace>* — per-instance log. One per InstanceKey, so two rust-analyzer actors on different workspaces get distinct buffers. lsp_server_log_name.
  • *lsp:<server>:<workspace>:trace* — per-instance JSON-RPC wire trace. Mirrors the log buffer but only carries LogSource::Trace records. lsp_server_trace_log_name.

The inverse helpers (parse_lsp_server_log_name, parse_lsp_trace_log_name) extract the originating InstanceKey from a synthetic name so a mode can derive its identity from its buffer’s name alone — no buffer-local seeding required (B’.7).

§Invariant

Server ids never contain :. The parsers split on the first colon after *lsp:; everything between that and the trailing * (or :trace*) is the workspace path. Workspaces with literal colons in their path (rare on POSIX, non-existent on Windows drive letters with \\?\C:\… because the registry normalises) survive because the workspace segment is the remainder — the parser does not split it further.

Constants§

LSP_SUBSYSTEM_LOG_NAME
Synthetic name for the subsystem-wide *lsp* buffer.

Functions§

lsp_server_log_name
Build the synthetic name for the per-instance LSP log buffer owned by crate::modes::LspServerLogMode.
lsp_server_trace_log_name
Build the synthetic name for the per-instance LSP trace buffer owned by crate::modes::LspTraceLogMode.
parse_lsp_server_log_name
Recover the InstanceKey from a per-instance log buffer name. Returns None when name does not match the canonical *lsp:<server>:<workspace>* shape.
parse_lsp_trace_log_name
Recover the InstanceKey from a per-instance trace buffer name. Returns None when name does not match *lsp:<server>:<workspace>:trace*.