JamesRitchie / language-matlab

MATLAB/Octave language support for Atom
15 stars 9 forks source link

File type detection conflict between matlab and octave. #20

Open jarekwg opened 8 years ago

jarekwg commented 8 years ago

Both use .m files, so Atom has no way of knowing which language to use.

Would be nice to see an option to disable one of the languages entirely so that it doesn't mess with the other. At the very least, I'd like to disassociate the .m extension from octave.

I downloaded this package to use purely with matlab code, but currently I'm getting every file showing up as octave.

abbiekressner commented 8 years ago

I have the exact same problem. Have you come up with a solution, @jarekwg?

jarekwg commented 8 years ago

@abbiekressner

Didn't find a proper solution, however:

i) if you manually set the language to MATLAB in the bottom right, atom will remember your choice for that file (at least in the short term). This solution becomes tedious very quickly if you have a lot of .m files though.

ii) you can apply all formatting preferences (tab width, etc) in the octave section of this extension's settings, then just let atom autodetect your files as octave.

Neither option is great, but I ended up going with second as I had quite a number of files to work with.

abbiekressner commented 8 years ago

I think I actually found a working solution. I installed Atom's file-types package. Then I put the following lines in my config.cson.

"file-types":
  m: "source.matlab"

After restarting Atom, Matlab files are automatically recognized as Matlab instead of Octave. Hope it works for you too!