How do I add a file extension in the list of extensions supported by Adobe Brackets?

6

I'm using the files with html.eco extension in my WEB project and I'm trying to edit it in Adobe Brackets, but I can not specify that it should treat these files as HTML fonts. I would like Brackets to provide me with the typical HTML file features (like coloring the font, identifying the tags in the grammar, etc.)

In fact I noticed that this is possible when changing the languages.json file, however I am using the binary version and did not build from the sources.

link

I would just like to change some Brackets property or configuration file so I can edit my .html.eco files so that it understands that it is mime-type text / html     

asked by anonymous 13.02.2014 / 13:19

2 answers

2

This is not exactly what I expected but I discovered that I can create a simple extension for Brackets as follows:

main.js file

define(function (require, exports, module) {
    var LanguageManager = brackets.getModule("language/LanguageManager");
    var language = LanguageManager.getLanguage("html");
    language.addFileExtension("html.eco");
});

In Brackets, use the menu: Help > Show Extensions Folder

Create a new folder under user, and put the main.js file there

Mo MAC OS X This directory is ~/Library/Application Support/Brackets/extensions

Restart Brackets

To facilitate I created this trivial extension and made it available in GITHUB. To install do the following:

  • Select the menu item * File > Extension Manager ... / Install from URL ... * in Brackets
  • Fill in the URL field with https://github.com/joao-parana/add-file-extension and click the Install button
  • The extension is automatically enabled.

    I hope it helps the galley. I believe this functionality will be implemented in Brackets in a future release as it would be a simpler solution for those who just want to install and use Brackets.

        
    19.02.2014 / 19:02
    2
  • Open the file: Brackets\www\editor\EditorUtils.js

  • Add the corresponding extension within switch (ext)

  • For example:

     switch (ext) {
        ...
        case "eco":
            return "htmlmixed";
        ...
    

    Source: link

    Searching further, I found the supported language settings at language/languages.json in the current Brackets code:

    "html": {
        "name": "HTML",
        "mode": ["htmlmixed", "text/x-brackets-html"],
        "fileExtensions": ["html", "htm", "shtm", "shtml", "xhtml", "cfm", "cfml", "cfc", "dhtml", "xht", "tpl", "twig", "hbs", "handlebars", "kit", "jsp", "aspx", "asp", "master","cshtml","vbhtml"],
        "blockComment": ["<!--", "-->"]
    },
    

    And through LanguageManager we can add a new extension to the list , dynamically:

    var language = LanguageManager.getLanguage('html');
    LanguageManager.addFileExtension('eco');
    

    13.02.2014 / 13:24