Skip to content

Preserve original indentation when modifying indented functions #981

Open
@stenci

Description

@stenci

Describe the need of your request

When selecting an indented function, such as a class method, and requesting a change through the chat, the returned implementation lacks the original indentation. This leads to two main issues:

  1. The diff view under Diff Selection highlights the entire function as changed, even if only a small part was actually modified, due to indentation differences.
  2. Using Insert at Caret results in an incorrectly indented function, which requires manual adjustment and interrupts the workflow.

Proposed solution

Ensure that the returned code preserves the original indentation level of the selected function. This would allow for accurate diffs and proper insertion at the correct indentation level, reducing friction during iterative development within nested scopes.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions