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

Update indentation for PHP, JS, and TS#251465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aiday-mar merged 2 commits intomicrosoft:mainfromssigwart:singleLineConfig
Jun 17, 2025

Conversation

ssigwart
Copy link
Contributor

Based on feedback in#136593 (comment).

@aiday-mar, as I mentioned in the linked PR, I wasn't super thrilled with doing it this way based on my thoughts in#43244 (comment) and#43244 (comment). However, I did some testing and VS Code will now unindent when{ is pressed, which makes the original change to auto-indent still a change in expections, but something I can probably get used to. However, I noticed thatelse wasn't handle consistently in JS and TS, so I fixed those in here (I see that it was mentioned in#43244 (comment) too). Personally, I can probably remove my extension that reverted the original auto-indentation changes and adjust to the new indentation this PR introduces, but based on feedback from#43244, there might be some backlash when this gets merged.

Addresses#136592

  • For PHP, auto-indent afterif,elseif,else if,while,for andforeach. This also fixes an issue where hitting Enter on a blank line below a single lineif (or other) results in an extra tab.
  • For PHP, extra space after*/ and blank line.
  • For JS/TS, auto-indent forelse to be consistent with handling ofif statements

Testing

In the following PHP code, hit Enter on the last blank line, it will add a space in front of the new line.

/** * PHPDoc */

Similarly, if you have the following code and hit Enter on the blank line, it will add a tab in front of the new line.

if (1)1;

I also tested writing someif,else if, andelse statements in PHP, JS, and TS.

Addressesmicrosoft#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
@aiday-mar
Copy link
Contributor

Hi@ssigwart thank you for the PR! I will have a look!

@aiday-maraiday-marenabled auto-merge (squash)June 17, 2025 09:05
@vs-code-engineeringvs-code-engineeringbot added this to theJune 2025 milestoneJun 17, 2025
@aiday-maraiday-mar merged commit7c43b02 intomicrosoft:mainJun 17, 2025
7 checks passed
@ssigwartssigwart deleted the singleLineConfig branchJune 17, 2025 18:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@benibenjbenibenjbenibenj approved these changes

@aiday-maraiday-maraiday-mar approved these changes

Assignees

@rebornixrebornix

Labels
None yet
Projects
None yet
Milestone
June 2025
Development

Successfully merging this pull request may close these issues.

4 participants
@ssigwart@aiday-mar@benibenj@rebornix

[8]ページ先頭

©2009-2025 Movatter.jp