Where's the `language-c` core package actually installed?


#1

I found in the Flight Manual, on Git/Issues and here on Discuss how to add a file extension to a given langauge-mylanguage-syntax package by adding to the 'source': field in the package’s config.cson or whatever. I did this with, for instance, language-lua and moonscript because Moonscript has Luaish syntax.

I’d like to do the same thing with language-c, but there’s no ~/.atom/packages/language-c folder, even though the package is default with atom and so it must be installed.

How can I edit language-c's config to make it auto-recognise arbitrary file extensions?


#2

You don’t have to (and shouldn’t) edit the actual package to force it to recognize additional file extensions. If you want to edit the config.cson, which stores your personal configuration by the way, you can open it by:

  1. Activating the Command Palette with Shift+Cmd+P on OS X or Ctrl+Shift+P on other platforms
  2. Search for and execute the “Application: Open Your Config” command

#3

Okay, so in my config.cson, what do I add to the .c.source field? I haven’t been able to find out how to do it this way.

".c.source":
  editor:
    preferredLineLength: 180

#4

Customizing recognition of file extensions works as specified here:

If you want files with the extension foo to be recognized as C language files, you would find the core subsection in your config.cson and add something like this to the customFileTypes subsection (or add customFileTypes if it isn’t already there):

'*':
  'core':
    'customFileTypes':
      'source.c': [
        'foo'
      ]

If you’re not used to editing CSON by hand, keep in mind that it works like JSON, duplicate keys overwrite.