Skip to main content

Module code_actions

Module code_actions 

Source
Expand description

v0.26 (ADR 0054): pure codeAction computation — quick-fixes from the structured bynk_syntax::error::Suggestions riding on a cached analysis round’s diagnostics.

Keying rule: a diagnostic’s suggestions are offered when the requested range intersects the diagnostic’s span — never the edits’ spans, which for both given fixes land away from the squiggle (the usage site in the body vs the clause in the signature). Positions convert against the analysed snapshot (the v0.24 rule); edits are versioned against the analysed document version, so a drifted buffer rejects the edit rather than mis-applying it.

Functions§

filter_by_only
#804: filters a combined codeAction response against CodeActionParams.context.only, the LSP field a client sets to restrict which action kinds it wants back. None (the field unset) returns actions unchanged. A requested kind matches an action’s kind if they’re equal or the action’s kind is a dotted child of it (LSP prefix-match semantics: refactor matches refactor.extract). An action with no kind, or a bare Command, never matches a non-empty only — the client can’t have asked for a kind we don’t advertise.
quick_fixes
Quick-fixes for every suggestion whose owning diagnostic intersects the requested range. text and version are the analysed snapshot and the open-document version captured with it.