Skip to content

Fix Reindent Lines for Rust files with square brackets (#333062) - #333326

Open
Aniket Saha (Aniket-a14) wants to merge 1 commit into
microsoft:mainfrom
Aniket-a14:fix/rust-reindent-square-brackets
Open

Fix Reindent Lines for Rust files with square brackets (#333062)#333326
Aniket Saha (Aniket-a14) wants to merge 1 commit into
microsoft:mainfrom
Aniket-a14:fix/rust-reindent-square-brackets

Conversation

@Aniket-a14

@Aniket-a14 Aniket Saha (Aniket-a14) commented Aug 29, 2026

Copy link
Copy Markdown

Summary

Fixes #333062. Reindent Lines on Rust files misindents code that uses [/] (e.g. vec![...]), with the error compounding on every following line.

extensions/rust/language-configuration.json's indentationRules only recognized {} and () for indent increase/decrease, omitting [] entirely. This fix adds [/] symmetrically, matching how typescript-basics' language configuration already handles all three bracket types.

Test plan

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-a14
Aniket Saha (Aniket-a14) force-pushed the fix/rust-reindent-square-brackets branch from 4cb35db to 9b29d24 比较 August 29, 2026 09:50
@Aniket-a14

Copy link
Copy Markdown
Author

Hey Aiday Marlen Kyzy (@aiday-mar) can your review the pr?

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

"Reindent Lines" doesn't work correctly with square brackets

2 participants