language-matlab icon indicating copy to clipboard operation
language-matlab copied to clipboard

File type detection conflict between matlab and octave.

Open jarekwg opened this issue 8 years ago • 3 comments

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.

jarekwg avatar Apr 19 '16 03:04 jarekwg

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

abbiekressner avatar Jun 03 '16 16:06 abbiekressner

@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.

jarekwg avatar Jun 04 '16 02:06 jarekwg

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!

abbiekressner avatar Jun 06 '16 07:06 abbiekressner