Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c43b02

Browse files
Update indentation for PHP, JS, and TS (#251465)
* Update indentation for PHP, JS, and TS.Addresses#136592- For PHP, auto-indent after `if`, `elseif`, `else if`, `while`, `for` and `foreach`. This also fixes an issue where hitting Enter on a blank line below a single line `if` (or other) results in an extra tab.- For PHP, extra dot after `*/` and blank line.- For JS/TS, auto-indent for `else` to be consistent with handling of `if` statements* polish---------Co-authored-by: Aiday Marlen Kyzy <amarlenkyzy@microsoft.com>
1 parentd59fac3 commit7c43b02

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

‎extensions/javascript/javascript-language-configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"pattern":"^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$"
122122
},
123123
"indentNextLinePattern": {
124-
"pattern":"^((.*=>\\s*)|((.*[^\\w]+|\\s*)(if|while|for)\\s*\\(.*\\)\\s*))$"
124+
"pattern":"^((.*=>\\s*)|((.*[^\\w]+|\\s*)((if|while|for)\\s*\\(.*\\)\\s*|else\\s*)))$"
125125
}
126126
},
127127
"onEnterRules": [

‎extensions/php/language-configuration.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,14 @@
9494
],
9595
"indentationRules": {
9696
"increaseIndentPattern":"({(?!.*}).*|\\(|\\[|((else(\\s)?)?if|else|for(each)?|while|switch|case).*:)\\s*((/[/*].*|)?$|\\?>)",
97-
"decreaseIndentPattern":"^(.*\\*\\/)?\\s*((\\})|(\\)+[;,])|(\\]\\)*[;,])|\\b(else:)|\\b((end(if|for(each)?|while|switch));))"
97+
"decreaseIndentPattern":"^(.*\\*\\/)?\\s*((\\})|(\\)+[;,])|(\\]\\)*[;,])|\\b(else:)|\\b((end(if|for(each)?|while|switch));))",
98+
// e.g. * ...| or */| or *-----*/|
99+
"unIndentedLinePattern": {
100+
"pattern":"^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$"
101+
},
102+
"indentNextLinePattern": {
103+
"pattern":"^\\s*(((if|else ?if|while|for|foreach)\\s*\\(.*\\)\\s*)|else\\s*)$"
104+
}
98105
},
99106
"folding": {
100107
"markers": {

‎extensions/typescript-basics/language-configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
"pattern":"^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*\\*([ ]([^\\*]|\\*(?!/))*)?$"
140140
},
141141
"indentNextLinePattern": {
142-
"pattern":"^((.*=>\\s*)|((.*[^\\w]+|\\s*)(if|while|for)\\s*\\(.*\\)\\s*))$"
142+
"pattern":"^((.*=>\\s*)|((.*[^\\w]+|\\s*)((if|while|for)\\s*\\(.*\\)\\s*|else\\s*)))$"
143143
}
144144
},
145145
"onEnterRules": [

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp