Need to create a mapping of file extension to lstlisting language code, then add [language=xxxx] tag to lstlisting environments.