Search code examples
ssiadobe-edgeadobe-brackets

Can I make Brackets/Edge Code CC highlight a .ssi file as if it were an HTML file?


My .SSI file in Adobe Edge Code CC is treated as plaintext as you can see from this image: Screenshot of Adobe Edge Code displaying a .ssi file

I would like it to syntax highlight as per a .html file. I have tried the extensions registry at: https://brackets-registry.aboutweb.com/ and cannot find anything appropriate. Perhaps I am looking in the wrong place?


Solution

  • Update: this is now much easier to do:

    1. Open the .ssi file
    2. In the status bar (lower-right), click the dropdown that says "Text"
    3. Choose a different option (HTML in this case)
    4. Open the dropdown again and choose the "Set as Default" option at the top

    Original answer:

    You don't have to clone Brackets from git as suggested in the other SO answer - it was only needed because the file extension in that case was already assigned to a different language (which isn't that common).

    For unassigned file extensions like .ssi, you can create a very simple Brackets extension - just a main.js file containing this code:

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

    This is easier to set up than pulling from git, and a little more foolproof. (In the future, this should be more even easily configurable though).

    For more info, see this answer: how to add file extension in adobe-brackets editor ?