Build Haml automatic in sublime 3 doesn't work

465 views Asked by At

I'm trying to let Sublime build haml files automatic on save. I've installed SublimeOnSaveBuild, added haml extension:

{
    "filename_filter": "\\.(css|js|sass|less|scss|haml)$",
    "build_on_save": 1
}

and created haml.sublime-build in AppData\Roaming\Sublime Text 3\Packages\User:

{
    "cmd": ["haml"],
    "working_dir": "${file_path:${folder}}",
    "selector": "source.haml",
    "file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",

    "windows":
    {
        "cmd": ["haml", "--trace", "$file", "${file_base_name}.html"],
        "shell": "true"
    }
}

As a result it works fine if I set build system = haml, but it doesn't if I try to set automatic ddetection of build system. Can anyone help with this issue?

P.S. I'm using sublime 3 without any additional plugins and extensions, but SublimeOnSaveBuild

P.P.S Also automatic detection works good for scss files

1

There are 1 answers

0
user1820686 On BEST ANSWER

The problem was in line

"selector": "source.haml"

It happens because file's scope for haml looks a bit different - "text.haml" instead of "source.haml". So I've change line above to:

"selector": "text.haml"

and in works for me. You may find out the file's scope in sublime by pressing Ctrl + Alt + Shift + P on file's tab