Can't comment PHP


#1

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 ?


#2

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.


#3

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:


#4

Instead of Auto-detect try selecting PHP format.