Skip to content

Conversation

chbndrhnns
Copy link
Contributor

Formatting was applied to a detached block and then per-statement after insertion, which broke Python suite indentation and disturbed nearby comments.

Now:

  • Perform one context-aware indentation adjustment (adjustLineIndent) over the contiguous inserted range after insertion; commit/unblock the document first.
  • Detect and delete redundant self-assignment (e.g., x = x) from single-return inlining.

Fixes https://youtrack.jetbrains.com/issue/PY-83746/Inline-refactoring-deletes-code
Fixes https://youtrack.jetbrains.com/issue/PY-83747/Inline-refactoring-creates-syntax-error-with-wrong-indentation

Formatting was applied to a detached block and then per-statement after insertion, which broke Python suite indentation and disturbed nearby comments.

Now:
  - Perform one context-aware indentation adjustment (adjustLineIndent) over the contiguous inserted range after insertion; commit/unblock the document first.
  - Detect and delete redundant self-assignment (e.g., `x = x`) from single-return inlining.
@BartvHelvert BartvHelvert added the PyCharm Pull requests for PyCharm label Aug 30, 2025
@avokin2 avokin2 assigned KalininDL and unassigned avokin2 Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PyCharm Pull requests for PyCharm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants