Skip to content

fix: enhance part of onEnter#21957

Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
asukaminato0721:1665
Apr 6, 2026
Merged

fix: enhance part of onEnter#21957
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
asukaminato0721:1665

Conversation

@asukaminato0721
Copy link
Copy Markdown
Contributor

improve some onEnter handling, now it supports some more cases.

@asukaminato0721 asukaminato0721 marked this pull request as ready for review April 5, 2026 02:45
Copilot AI review requested due to automatic review settings April 5, 2026 02:45
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 5, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands onEnter indentation support beyond comment continuation, adding indentation behavior for additional brace-delimited syntactic constructs and updating contributor documentation accordingly.

Changes:

  • Update onEnter implementation to indent after { for single-line module item lists and broaden/centralize brace-list indentation logic.
  • Adjust block indentation logic to support empty blocks and refactor “contents end” calculation.
  • Update docs to reflect the now partially implemented indentation behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/book/src/contributing/lsp-extensions.md Updates documentation to reflect newly supported onEnter indentation cases.
crates/ide/src/typing/on_enter.rs Adds indentation support for module item lists, enables empty-block indentation, and refactors brace-list indentation into a shared helper with updated tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of listing all braces we have, it's better to handle it via tokens: detect {$0}.

View changes since this review

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 6, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash and fix Clippy, then LGTM.

View changes since this review

detect {$0}

reduce reduction

update based on comment

clippy
Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Apr 6, 2026
Merged via the queue into rust-lang:master with commit 1412ac0 Apr 6, 2026
17 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 6, 2026
@asukaminato0721 asukaminato0721 deleted the 1665 branch April 6, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants