Fix indentation issues when generating or transforming code with inline assistant (#2961)

This pull request extracts a separate `Codegen` struct that models the
interaction with OpenAI and takes care of diffing, auto-indenting and
reporting regions to highlight.

As part of this refactoring, we're now relying less on the AI model to
indent code. The new logic lets tree-sitter decide how the first line
should be indented. Then, for every subsequent line reported by ChatGPT,
it calculates an indent delta relative to the first reported line and
applies it to the indent level chosen by tree-sitter.

Release Notes:

- Improved auto-indentation when using the inline assistant.
5697a87f4aAntonio Scandurra committed on 9/13/2023, 10:45:44 AM· committed by GitHubparents329a072127d035
7 files changedLine totals unavailable