Language Selection - Autodetect doesn't work


#1

Hey all!

(if this topic has already been flagged can someone link me :slight_smile: )

I realised there was an autodetect feature when you select a language, this would be incredibly useful as I work with languages that unfortunately that start much later in the alphabet xD

However I also realised that it didn’t work, I tested it by doing ‘<?php’ to see if it would recognise the opening syntax. No idea if thats a proper test… but it didn’t work nontheless…

also, a side-note: is there a way to set a default language?


#2

I think Atom guesses the language by looking at the extension… But maybe something like -- Hey, Emacs! -- exists… Don’t know, though…


#3

I think what you are looking for is covered in Set HTML syntax on file.html.js which discusses how to get Atom to apply the HTML grammar to a custom file extension:


#4

PHP currently isn’t recognized well:

As a matter of fact, if the first line contains anything indicating that it is an HTML file, it is recognized as an HTML file, not a PHP file. This is due to a limitation in the first-mate package that recognizes the type of file first from the first line of the file and then from the file’s extension.


#5

Hi,
same for me. XML and JSON not recognized :frowning:
Always have to select it manualy.
I may be wrong but I could remember it was working on early version :confused:

regs,
Yann