Skip to content

Commit 853fb8d

Browse files
committed
Consider comment after intro token when increasing indent
Fixes #1222
1 parent 61d0b16 commit 853fb8d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1414

1515
- Sync to upstream Luau 0.698
1616

17+
### Fixed
18+
19+
- Fixed auto-indentation in VSCode when entering a block if there is a comment after the introduction token (e.g., `if true then -- comment`) ([#1222](https://github.com/JohnnyMorganz/luau-lsp/issues/1222))
20+
1721
## [1.55.0] - 2025-10-19
1822

1923
### Added

editors/code/language-configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"autoCloseBefore": ">}])` \n\t",
4141

4242
"indentationRules": {
43-
"increaseIndentPattern": "^((?!(\\-\\-)).)*((\\b(function|do|repeat)\\b((?!\\b(end|until)\\b).)*)|(\\{\\s*)|(\\b(then|else)\\b[;\\s]*))$",
43+
"increaseIndentPattern": "^((?!(\\-\\-)).)*((\\b(function|do|repeat)\\b((?!\\b(end|until)\\b).)*)|(\\{\\s*)|(\\b(then|else)\\b[;\\s]*))(\\-\\-.*)*$",
4444
"decreaseIndentPattern": "^\\s*((\\b(end|until)\\b)|(\\})|(\\))|(\\b(else)\\b[;\\s]*))"
4545
}
4646
}

0 commit comments

Comments
 (0)