Skip to main content

Module fix_all

Module fix_all 

Source
Expand description

#2100 slice 6: the source.fixAll.bynk code action — apply every machine-applicable diagnostic suggestion in a file as one edit.

The selection rule (DECISION C) lives in bynk_syntax::fix, shared with bynk check --fix (#2642); this module adapts it to the IDE’s [bynk_ide::Diagnostic] and builds the LSP action. The code_action handler adds DECISION B’s safety gate: the combined edit is offered only if the re-analysed project has no diagnostic the round didn’t already have.

Functions§

action
The versioned source.fixAll.bynk action for edits.
apply
The text with edits (sorted, non-overlapping) applied. An edit whose span isn’t a valid range of text, or that overlaps the one before it, is skipped rather than panicking.
edits
Every edit fix-all would apply to text, the file whose diagnostics these are. See bynk_syntax::fix::edits.
kind
The source.fixAll.bynk kind.