Skip to main content

Module capability_path

Module capability_path 

Source
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_path keeps each chain’s own sites, a shared site repeated, so a client can mark where one path ends and the next begins (#2534).
PathView
The round’s tables, positioned on one file.
StepLocation
A location the client peeks at: a step’s site.

Constants§

CLIENT_CAPABILITY
The ClientCapabilities.experimental key a client sets to true to say it implements SHOW_COMMAND.
SHOW_COMMAND
The client-side command the code action invokes. The VS Code extension registers it (src/capabilityPath.ts in 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 given entry at offset: the shortest chain, one linked step per line. None off an entry or when the entry reaches no use (it is unused — bynk.given.unused_capability says so).
show_action
The “Show capability path” action for the given entry at offset, 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.