Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No auto indent for case body in JavaScript #48735

Closed
mic4ael opened this issue Apr 26, 2018 · 3 comments
Closed

No auto indent for case body in JavaScript #48735

mic4ael opened this issue Apr 26, 2018 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues javascript JavaScript support issues verified Verification succeeded
Milestone

Comments

@mic4ael
Copy link

mic4ael commented Apr 26, 2018

  • VSCode Version: 1.22.2 (x64)
  • OS Version: Fedora 27 (4.15.17-300.fc27.x86_64)

Steps to Reproduce:

peek 2018-04-26 09-48

  1. Write a simple switch statement like this
switch (action.type) {
    case 'test':
    return    
}
  1. The indentation seems to be broken. return is in the same column as case and also there are 4 spaces added after return

Does this issue occur when all extensions are disabled?: Yes

@vscodebot
Copy link

vscodebot bot commented Apr 26, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added editor editor-autoindent Editor auto indentation issues labels Apr 26, 2018
@mic4ael
Copy link
Author

mic4ael commented May 2, 2018

Also it is worth to mention that the issue occurs on my Linux OS as well as OSX.

@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Sep 11, 2018
@mjbvz mjbvz added this to the April 2019 milestone Apr 9, 2019
@mjbvz mjbvz closed this as completed in 88a6b2f Apr 9, 2019
@mjbvz mjbvz changed the title [JavaScript] Wrong indentation of case blocks No auto indent for case body in JavaScript Apr 9, 2019
@mjbvz mjbvz added the javascript JavaScript support issues label Apr 9, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Apr 9, 2019

Pushed fix. Please test in the next insiders build and let me know if auto-indenting cases proves helpful or annoying

mjbvz added a commit that referenced this issue Apr 9, 2019
Previous fix broke `reindent all lines` . New fix is only applied on enter and should handle bodies with multiple case better
@alexr00 alexr00 added the verified Verification succeeded label May 7, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues javascript JavaScript support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants