Fix Reindent Lines for Rust files with square brackets (#333062) - #333326
Open
Aniket Saha (Aniket-a14) wants to merge 1 commit into
Open
Fix Reindent Lines for Rust files with square brackets (#333062)#333326Aniket Saha (Aniket-a14) wants to merge 1 commit into
Aniket Saha (Aniket-a14) wants to merge 1 commit into
Conversation
Rust's indentationRules only recognized {}/() for increase/decrease
indent detection, omitting []. This caused indent state to drift
after any unclosed [ (e.g. vec![) or a line starting with ], with
the error compounding on every subsequent line.
Fixes microsoft#333062
Aniket Saha (Aniket-a14)
force-pushed
the
fix/rust-reindent-square-brackets
branch
from
August 29, 2026 09:50
4cb35db to
9b29d24
比较
Author
|
Hey Aiday Marlen Kyzy (@aiday-mar) can your review the pr? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
注册 for free
to join this conversation on GitHub.
Already have an account?
登录 to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #333062.
Reindent Lineson Rust files misindents code that uses[/](e.g.vec![...]), with the error compounding on every following line.extensions/rust/language-configuration.json'sindentationRulesonly recognized{}and()for indent increase/decrease, omitting[]entirely. This fix adds[/]symmetrically, matching howtypescript-basics' language configuration already handles all three bracket types.Test plan
getReindentEditOperations's algorithm standalone: old patterns reproduce the reported bad output line-for-line, new patterns restore correct indentation and are a no-op on already-correct code