Expand description
#2469: “why does this need Logger?” — the editor face of the checker’s
capability paths (bynk_check::capability_paths).
Hovering a given entry shows the shortest chain from the declaration to
the capability’s use, each step a link to source. The “Show capability path”
code action lists every chain: it carries a client-side command
(SHOW_COMMAND) that opens the editor’s references peek over the steps’
sites. Both read the checker’s recorded graph; nothing here re-derives a
path from the source text, and the full set is computed on demand by
bynk_check::capability_paths::CapabilityGraph::all_paths rather than stored per entry.
Because the command is executed by the client, the action is offered only
to a client that says it implements it —
experimental.capabilityPathCommand: true in its ClientCapabilities — the
same gate as the “Explain …” action (crate::explain_request).
Structs§
- AllPaths
- The full set of chains for the entry at
offset, flattened to the sites the peek lists (path by path, shortest first, a shared site once), with the capability, the entry’s position, the number of chains, and whether the checker’s cap cut the list short.AllPaths::by_pathkeeps each chain’s own sites, a shared site repeated, so a client can mark where one path ends and the next begins (#2534). - Path
View - The round’s tables, positioned on one file.
- Step
Location - A location the client peeks at: a step’s site.
Constants§
- CLIENT_
CAPABILITY - The
ClientCapabilities.experimentalkey a client sets totrueto say it implementsSHOW_COMMAND. - SHOW_
COMMAND - The client-side command the code action invokes. The VS Code extension
registers it (
src/capabilityPath.tsin bynk-lang/vscode-bynk).
Functions§
- all_
paths - client_
supports_ command - Whether the client advertised
experimental.capabilityPathCommand: true. - hover_
section - The hover Markdown section for the
givenentry atoffset: the shortest chain, one linked step per line.Noneoff an entry or when the entry reaches no use (it is unused —bynk.given.unused_capabilitysays so). - show_
action - The “Show capability path” action for the
givenentry atoffset, or none off an entry. Its command carries[uri, position, locations]for the client to hand to the editor’s references peek, then (#2534)by_path, each chain’s sites with shared ones repeated, for a client that groups the peek by path; a client that reads three arguments is unaffected.