propose abstract method

CodeEditProposal? propose(
  1. String source, {
  2. required String language,
  3. required int base,
  4. required int extent,
  5. required CodeEditingAction action,
  6. required String text,
  7. required String indentUnit,
})

The edit action makes of the code body source, whose selection runs from base to extent, or null to leave it to Flark's literal code editing. text is what CodeEditingAction.insert types, and indentUnit the step Tab inserts.

A proposal replaces CodeEditProposal.start..CodeEditProposal.end of source, which must be a range of it, with LF text, and selects CodeEditProposal.base..CodeEditProposal.extent of the result, which must lie within it. One for CodeEditingAction.indent or CodeEditingAction.outdent keeps source's number of lines. Flark refuses text with a carriage return as invalid source, and writes the rest into the fence with its container prefixes, as other code edits. A proposal outside these bounds is a delegate error: the command that asked for it throws a StateError.

Implementation

CodeEditProposal? propose(
  String source, {
  required String language,
  required int base,
  required int extent,
  required CodeEditingAction action,
  required String text,
  required String indentUnit,
});