Closed cbcoutinho closed 7 years ago
Just tried it out - it's getting recognized as PHP instead 😞. Can you verify this @cbcoutinho? https://github.com/atom/language-php/blob/master/grammars/php.cson#L16
Hi @50Wliu - yes I just noticed now that you mentioned it, it is indeed being caught up in PHP syntax.
On Mon, Jan 30, 2017 at 5:40 PM Wliu notifications@github.com wrote:
Just tried it out - it's getting recognized as PHP instead 😞. Can you verify this @cbcoutinho https://github.com/cbcoutinho? https://github.com/atom/language-php/blob/master/grammars/php.cson#L16
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/atom/language-shellscript/issues/69#issuecomment-276113877, or mute the thread https://github.com/notifications/unsubscribe-auth/AMTd7Lt1Rqi2I-ts1l4cUVKhVyHgudWQks5rXhJjgaJpZM4LxXU- .
And what's worse - I'm not even getting a PHP icon. If PHP is in fact correct about the file extension, then they have a file-icon issue on their hands as well.
What does atom allow you to do when two languages have identical file extensions?
Another one that comes to mind is Matlab .m
files and Objective-C .m
files. I just know I'm working with Matlab, but the grammar and syntax think otherwise
You can set custom filetype associations: https://discuss.atom.io/t/how-do-i-make-atom-recognize-a-file-with-extension-x-as-language-y/26539
For MATLAB, try searching for a language package for it. Community packages have higher precedence than core packages.
Wonderful, thanks for the link. I was able to fix the issue by overriding the file associations as described in your link.
Specifically, I solve the issue by adding the following snippet to my config.cson
:
core:
customFileTypes:
'source.shell': ['profile']
'source.matlab': ['m']
Thanks again for the quick reply!
My
.bashrc
file is correctly recognized as a shell script, but my.profile
file is not - no syntax highlighting or filename recognition whatsoever.I looked at shell-unix-bash.cson, lines 3-26 and see that
.profile
is a supported filetype along with.bashrc
, so I'm not sure what the issue is. A missing period somewhere in a parser maybe? Anyways, I hope you have an easier time finding the problem that I am.Thanks in advance!