question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML Auto-indent Does Not Work If Original File Type is PHP

See original GitHub issue
  • VSCode Version: Version: 1.28.2 (user setup) Commit: 7f3ce96ff4729c91352ae6def877e59c561f4850 Date: 2018-10-17T00:23:51.859Z Electron: 2.0.9 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Architecture: x64
  • OS Version: Windows 7

Steps to Reproduce:

  1. Create new PHP file
  2. Type in div.class, hit tab, hit enter

Current Solution:

Change file type to HTML, and then back to PHP

Proposed solution:

In a file type where HTML tab-completion works, HTML auto-indenting should also work

Does this issue occur when all extensions are disabled?: Quick Google search did not provide clear instructions on how to perform this in Windows.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:5

github_iconTop GitHub Comments

3reactions
TomS-commented, Jul 4, 2019

This is definitely a bug, the fact that it’s been around for so long is a little concerning. I’ve been quite about this for a while. But it’s really starting to annoy me. It’s a shame because VSCode is amazing code editor otherwise.

0reactions
samintoncommented, Jun 4, 2021

#103147 reported this a while ago and got a rather unsatisfying response… I have yet to find a solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

autoindent don't work in php file - Stack Overflow
When I edit php file,the autoindent setting just don't work.It works in js css and any other files.Only in php file,I need to...
Read more >
Vim: How to indent html code correctly in php file? - Super User
My workaround for this is to temporarily switch to html mode, mark region and indent, and then go back to php mode. :set...
Read more >
Auto indent turns off itself automatically on php files
It might be better to use autocmd FileType * setlocal autoindent instead. It is true that that will not be triggered if the...
Read more >
indent.txt - Vim
Note that 'cindent' indenting does not work for every code scenario. ... will reindent the line only if the key is the first...
Read more >
Auto-indent from HTML/PHP on OSX not working
This behaviour happens in both PHP and HTML files/syntaxes. Interestingly enough, indentation works just perfectly if I manually set the syntax ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found