Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Make file type -> language mapping locally configurable #1718

Closed

Description

@kevinsawicki

Several halp issues about people wanting to add extensions to language plugins.

Currently they have to fork the package to do this, might be nice to support this through the config.

Activity

  1. nathansobo commented on Mar 6, 2014

    @nathansobo
    Contributor

    Not sure I understand.

  2. probablycorey commented on Mar 6, 2014

    @probablycorey

    They could make a dummy language that with the extension and includes the grammar they want to extend. But that is pretty cumbersome.

    Were you thinking of a config option like this:

    core:
      scopeForExtension:
         '.rake': 'source.ruby'
         '.moo': 'source.cowSpeak' 
  3. kevinsawicki commented on Mar 6, 2014

    @kevinsawicki
    ContributorAuthor

    @probablycorey Yup, something like that.

  4. rsanchezsaez commented on Jul 14, 2014

    @rsanchezsaez

    +1.

    It's really sad that Atom doesn't support this...

    Case in point: adding Podfile to Ruby syntax highlighting.

  5. rsanchezsaez commented on Jul 20, 2014

    @rsanchezsaez

    If somebody wants a little StackOverflow reputation bounty, implement this and reply here. :D

  6. xpol commented on Aug 14, 2014

    @xpol

    And with UI described in #1784 is nice.

  7. ddaws commented on Sep 16, 2014

    @ddaws

    👍 this would be a great feature.

  8. hellerchr commented on Oct 2, 2014

    @hellerchr

    +1

  9. self-assigned this
    on Oct 2, 2014
  10. steelbrain commented on Nov 26, 2014

    @steelbrain
    Contributor

    +1

  11. steph643 commented on Nov 30, 2014

    @steph643

    +1

  12. tomByrer commented on Dec 13, 2014

    @tomByrer

    Would be nice to add the following filetype to language-json please:
    .jsbeautifyrc

    (I'll keep adding to list as I find).

  13. 43 remaining items

  14. derwaldgeist commented on Dec 7, 2015

    @derwaldgeist

    Thanks, I will try this!

  15. jdnier commented on Jan 10, 2016

    @jdnier

    @omnidan You have an extra set of brackets. Try this instead (survives restarting Atom):

      core:
        customFileTypes:
          "source.js-semantic": [
            "js"
          ]
  16. omnidan commented on Jan 10, 2016

    @omnidan

    @jdnier Thanks for the info 😄 Shouldn't it be source.js and js-semantic though (not the other way around)?

  17. oshliaer commented on Feb 3, 2016

    @oshliaer

    v1.4.3

    core:
        customFileTypes:
            "source.js": [
                "js-semantic"
            ]

    It works fine. But this way registers an extension as the scope's (from the example as source.js) Grammar. This can be confusing for some extensions of Atom.

  18. emattias commented on Feb 16, 2016

    @emattias

    Is there support for extensionless files?

    This doesn't work for me:

    "*":
      core:
        customFileTypes:
          "source.shell": [
            ""
          ]
  19. alexchandel commented on Feb 17, 2016

    @alexchandel
    Contributor

    As the confusion and abundant trailing comments make clear, there needs to be a GUI for this, just like the Keybindings GUI.

  20. Pysis868 commented on Mar 17, 2016

    @Pysis868

    I wonder if this can reload the active views automatically, in case I have the file open already I want it to update and use the appropriate, new grammar I have just specified?

    Even better, add the ".railsrc" file I was working in to a core list inside Atom :).

    I have posted more information here: Atom - Discuss - Edit/Set File Associations

  21. winstliu commented on Mar 17, 2016

    @winstliu
    Contributor

    Even better, add the ".railsrc" file I was working in to a core list inside Atom :).

    Feel free to do so by editing https://github.com/atom/language-ruby-on-rails/blob/master/grammars/ruby%20on%20rails.cson (I'm assuming .railsrc is Ruby on Rails? If it's not just find the appropriate language repository) and submitting a PR.

  22. Pysis868 commented on Mar 17, 2016

    @Pysis868

    hm, after some Googling I have found .railsrc to actually be more of a plain text file that merely contains shell-like options on each line.

    It seems the code I used from this post luca pette - Pry Everywhere uses the filename incorrectly, as the style I just found elsewhere is more prevalent.

    Since this is Atom's default grammar, I will leave it untouched :).

  23. omniacode commented on Jun 20, 2016

    @omniacode

    Hate to reopen this discussion again, but this doesn't seem to be working in v1.8? Anyone else having issues with this? According to this thread, this should work:

    customFileTypes: "source.pdt": [ "php" ]

  24. undercoverSG commented on Jun 24, 2016

    @undercoverSG

    Not working for me ever for rapid language which is mod extension:
    customFileTypes:
    "source.python": [
    "mod"
    ]

    What is really missing is the possibility to customize your own grammar and style. Like for new language or very old one. (RUST, Pascale, DELPHI, Basic..)

    Having the possibilty to customize your own language would be pretty useful, and not using a setup of an existing one

  25. stijnsanders commented on Jun 24, 2016

    @stijnsanders

    I'm using language-pascal for Delphi, which works kind-of OK.

  26. undercoverSG commented on Jun 27, 2016

    @undercoverSG

    Yes in that case it works, but for instance, if i do assembly, what will you use ?

    The feature is pretty cool it is sure, but i'm wondering how to make my own syntax coloring for any language that have no common point with an other.

  27. viktorsec commented on Jul 11, 2016

    @viktorsec

    +1

  28. locked and limited conversation to collaborators on Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions