-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sublime does not enable extension in correct context #6
Comments
Edit: I see from reading the readme this may be by design: In which case this could be tagged as an enhancement. |
I haven't heard of Twig yet, but on a quick research it seems that it supports multiple template systems? If that's the case I wouldn't want to hardcode the file type association into the Handlebars package as people who use other templates would be really annoyed that the wrong package is trying to handle their files :) Can you name you file .twig.handlebars? As for using it inside a HTML script tag, that's a change in the HTML package. It would need to understand that the tag contains Handlebars and load the language definition. I'm not even sure if that package is on Github, if you find it I can try to work with whoever is maintaining it :) |
I guess the html scoping is handled by sublime natively. The scope within a script tag (embedded) is: text.html.basic source.js.embedded.html This seems like a narrow enough scope I think? Where there are conflicts in autocompletion (for example 'if'), between raw js and handlebars, ST2 usually displays both options in a dropdown menu. I think this would be acceptable (what do you reckon?) edit: Similar issue in jQuery snippets bundle - with relevant commit: As for twig - Is it possible to only enable if the file extension is 'handlebars.twig' rather than just '.twig' (you are right re: twig supporting multiple template systems). I wouldn't want to change the file extension as .twig is an extension which requires compiling (It's a handlebars file written IN twig rather than the inverse). Cheers |
Added a separate PR - will close this. |
I find that I have to manually change the detected syntax to handlebars to get this to work.
I have two scenarios.
Files with the extension 'handlebars.twig' - which are handlebars files written using the twig templating language
(solving this would also solve the above I think) - Within html files where my handlebars template is defined inline, within a script tag with the appropriate type i.e (text/x-handlebars)
The text was updated successfully, but these errors were encountered: