Skip to content

Latency - #2

Merged
CppCXY merged 4 commits into
mainfrom
latency
Nov 27, 2026
Merged

CppCXY merged 4 commits into
mainfrom
latency

Conversation

@CppCXY

@CppCXY CppCXY commented Nov 27, 2026

Copy link
Copy Markdown
Owner

No description provided.

A request no longer calls AnalysisState::catch_up: the update queue's writer and didOpen own the index impact before the request barrier, and a completion that drained unread includes synchronously repeated up to nine reads and write commits on the hot path. The first completion measured 540 ms with the call removed versus 990 ms with it; steady state is 4–6 ms either way. The rendering is still built on demand by view_of_the_rendering_now.

last_rendered now records the index's file count, so an include read cannot be hidden by a cache keyed only on text and prefix. The remaining per-request logs on the hot path (superseded requests, client cancellations, writer phases, no-member completions) are debug instead of info; the worklog no longer claims a per-request completion log.

Workspace tests: 914 + 1164 + 119 + 525 + 166 + 31 green; clippy -D warnings and fmt clean.
An edit drops the summary while the writer rebuilds it, and a recovered tree can still name only some of the functions. Answering that window with a partial list, an empty list, or ContentModified replaces (or clears) the client's lenses, which is the up/down jump reported while typing.

Keep a single last complete list for the document currently being asked about; it is one slot, not a map of every open tab, and it is what the client is already drawing. A complete answer replaces it, a workspace reload clears it, and an incomplete/partial answer returns the previous list unchanged. A source with parse errors is treated as incomplete so a recovered partial summary cannot overwrite the good list. The regression test edits a settled file, requests lenses again, then edits an unfinished brace and asserts the exact previous list is returned before the completed edit replaces it.

cpp_ls suite 120, workspace 914 + 1164 + 120 + 525, clippy -D warnings.
textDocument/codeLens now returns anchors with data and no command; it no longer calls places_of, so a reference index that is still filling cannot make the list partial or ContentModified. codeLens/resolve looks up the declaration and only then computes the reference count and command. CodeLensOptions advertises resolve_provider=true, and the wire tests resolve each lens before asserting its title (including the editor-command identity test and [code_lens] enable=false fixture).

The synchronous complete_lenses_of remains test-only. cpp_ls suite 119, workspace tests green, clippy -D warnings.
@CppCXY
CppCXY merged commit 84b3a41 into main Nov 27, 2026
12 of 15 checks passed
@CppCXY
CppCXY deleted the latency branch November 27, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant