Can't comment PHP


Hey :slight_smile: When I’m using Atom on some PHP file , the syntax is set on PHP by auto-detect, but when I try to comment a line with Cmd + Shift + / , I get html comment <!-- --> instead of // in front of the selected line …

Any idea of how I could fix this ?


Inside <?php ?>, I get // comments normally. Outside, I get HTML comments. This is because Atom chooses the style of comments not based on what the file’s grammar is, but what scope the cursor is inside. This allows for blended documents like most .php files.


Well in that case it’s really weird because I’m inside <?php ?> my file is a .php Symfony controller, so there is not a single line of HTML in it .

I got some plugins like Emmet but I don’t think it could be related :neutral_face:

I just switched from Sublime to Atom and love it so far, but this problem is annoying :confused:


Instead of Auto-detect try selecting PHP format.


I don’t know if is too late but I had the same issue. The problem was caused by Emmet package: try to disable it.