Add support for previous line patterns in the indentation rules #209804
Labels
editor-autoindent
Editor auto indentation issues
feature-request
Request for new features or functionality
This feature request is derived from #43244 (comment). Currently when Enter is typed after a braceless if statement, the next line is indented as follows:
Some users in the thread mentioned that after typing {} on that line, they want the code to be unindented at that position as follows:
We have the
unIndentedLinePattern
which we could use to solve this, that is we could unindent when the pair {} is encountered on a line. This however would cause issues generally, like in the following case:Here we do not want to decrease the indentation on typing the {} after the field name
a
. To mitigate this, we may want the indentation rules to support regex rules on the previous line. That is, we may want to have the following syntax in the language configuration file:In this way, the new syntax would ressemble more the syntax for the
onEnter
indentation rules.The text was updated successfully, but these errors were encountered: