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

annoying indentation bug while writing html in a php file #32871

Closed
saharso opened this issue Aug 21, 2017 · 6 comments
Closed

annoying indentation bug while writing html in a php file #32871

saharso opened this issue Aug 21, 2017 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues html HTML support issues php PHP support issues wont-fix

Comments

@saharso
Copy link

saharso commented Aug 21, 2017

  • VSCode Version: Code 1.15.1 (41abd21, 2017-08-16T18:07:25.676Z)
  • OS Version: Windows_NT x64 6.1.7601
  • Extensions: none

I have auto close tags toggled off in my preference configurations.

whenever i try to manually close an html tag, the closing tag ignore indentation and jumps to the left, which forces me to manually indent whenever I am trying to close a tag.

This is VERY ANNOYING and detrimental to my word flow and concentration. It started to happen after the next to last update.

Steps to Reproduce:

@nickysixer
Copy link

This is such an awful bug that has me rethinking my use of VS Code for PHP dev. When should we expect this to be fixed?

@alexdima alexdima added the editor-autoindent Editor auto indentation issues label Oct 26, 2017
@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Nov 16, 2017
@alexdima alexdima removed the editor label Nov 23, 2017
@RiFi2k
Copy link

RiFi2k commented Jul 24, 2018

I made this because I was annoyed at nested HTML in PHP, this should format based on whatever native settings you have for html.format and editor format on save/type Format HTML in PHP

@rebornix rebornix added html HTML support issues php PHP support issues labels Sep 6, 2018
@connor4312
Copy link
Member

There are several outstanding bugs around indentation in PHP, but this one no longer appears to reproduce.

Kapture 2019-10-11 at 10 58 23

@connor4312 connor4312 added the *not-reproducible Issue cannot be reproduced by VS Code Team member as described label Oct 11, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 11, 2019

We closed this issue because we are unable to reproduce the problem with the steps you describe. Chances are we've already fixed your problem in a recent version of VS Code. If not, please ask us to reopen the issue and provide us with more detail. Our issue reporting guidelines might help you with that.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Oct 11, 2019
@connor4312
Copy link
Member

Apologies, some more details --

This appears to be an interaction between the HTML language server and PHP. Opening a PHP file in VS Code and then trying to reproduce the issue won't yield results, but if you open an HTML file (or change the file to HTML and back again), then this issue occurs.

@connor4312 connor4312 reopened this Oct 11, 2019
@connor4312 connor4312 removed the *not-reproducible Issue cannot be reproduced by VS Code Team member as described label Oct 11, 2019
@rebornix
Copy link
Member

rebornix commented Nov 3, 2020

This is due to the limited architecture (regex based indentation rules and only support limited code styles), we may want to consider using formatters if they exist for indenation adjustment (if interested, we can discuss in #19847).

For this particular issue, if the indentation rules are leading to more trouble than having no auto indent, you can set editor.autoIndent to advanced to disable the regex based indentation adjustment. As we don't have an easy good-enough fix for it, we close it for now and explore better solutions through issues like #19847.

@rebornix rebornix closed this as completed Nov 3, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2020
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 html HTML support issues php PHP support issues wont-fix
Projects
None yet
Development

No branches or pull requests

7 participants