Expand description
#855: bynk/wireContract — the wire-contract-peek custom LSP request.
File-scoped + position, like #846’s bynk/sequenceModel (the panel is
per-handler, not project-wide like #851’s bynk/architectureModel): the
params carry a textDocument + position and the result is one
handler’s wire contract, or null when nothing resolves. Same on-demand
posture as every custom request in this server — no workspace/*/refresh
nudge exists for one and none is needed (see sequence_request’s module
doc for why).
Two responsibilities live here: WcModel and its hand-mirrored Wc*
siblings — a plain serde shape for bynk_ide::wire_contract::WireContractModel
and everything it contains (bynk_check::wire::WireModel included) —
and to_wire, which lowers one to the other, Span → {uri, range}
the same way architecture_request.rs does (this module reuses its
WireLoc under the WcLoc alias rather than redeclaring an identical
struct).
Cross-file type locations. A boundary type may be declared in a
different file than the handler being hovered — the whole reason
ContextBoundaryInfo::types (Phase 3) is a combined table (own
declarations plus every uses target’s). WireContractModel::type_sites
(bynk-ide/src/wire_contract.rs) carries only a bare Span per type
name, with no file — a single project-relative path cannot be assumed
(that path is the handler’s file, not necessarily the type’s). This
module resolves each boundary type’s own file the same way every other
cross-file lookup in this server does: through the already-assembled
bynk_check::index::ProjectIndex, searching the candidate units in
doc_scope’s order (itself first, then uses targets, then consumes
targets — #848’s existing search order, reused rather than re-derived).
A type whose def cannot be resolved this way renders with loc: null
rather than a guessed location — the same “never send a bogus location”
rule architecture_request.rs’s wire_loc follows.
Re-exports§
pub use crate::architecture_request::WireLoc as WcLoc;
Structs§
- WcContract
Form - WcField
- WcHttp
Response - WcModel
- WcParam
- WcType
- WcVariant
- Wire
Contract Params - The
bynk/wireContractrequest payload — a text-document position, the same two-field shapeSequenceModelParams/every cursor-anchored request in this server uses.
Enums§
Functions§
- to_wire
- Lower a
WireContractModelto its wire shape.