Open anod opened 13 years ago
does this work for php code, ie. if you open a *.html file with the PHP Editor - do you get PHP syntax highlighting?
I've added the html extension to the TwigStructuredEditor, but somehow it's still not using the TwigEditor. Same happens for PHP syntax if i open an *.html file with the php editor.
Yes, same behavior
This is how you can make the Twig editor recognizy any file extension you wish as twig content-type:
I'm atempting the same, but it won't use the twig syntax highlighting.
I set .html for twig template under content types. I also added .twig to file association and set twig editor as default.
I use the 'open with -> twig editor' method, still it won't work! Using Eclipse Juno and your nightly build
The same problem exists for PHP editor or smarty templates I tried some other stuff, created files with .twiggy and .smarty extension and it works fine. Then I tried creating a .lol extension template and if php, smarty and twig need to compete over it then twig always 'wins'.
There seems to be something wrong with eclipse ignoring the File Association or the custom choice with 'open with' and just going for whatever it feels should be the default
Okay I've been trying different stuff and the behavory is really weird.
I also installed http://eclipse.kacprzak.org/ since the django editor is almost the same as twig and it's working properly but nonetheless the behavory stays odd!
I created an imaginary file extension .ben Added that extension to the contenttypes PHP, Twig, Smarty and Django
Now I try to open the file with 'open with' and I get the following results: Django Editor -> opens in Django Editor Twig Editor -> opens in Twig Editor Smarty Editor -> opens in Twig Editor PHP Editor -> opens in Twig Editor
The default is set to Smarty Editor at this point so it's completely ignoring that ...
I don't get it, I just know it's messed up and if I can't even set it right for .ben then I'm definitely not going to get it right for .html ...
tested with clean install of indigo and juno, both are showing the same problem :(
Manually adding the TwigNature does the trick
what do you mean with TwigNature ?
trying to add *.html extension to work with twig highlighting. but it isn't working, even if open with twig editor.
added here "Under Text -> PHP Content Type -> Twig Template"
any advice?
Hello, I solved this with nature: rigth click on project: Configure-> Convert to Twig Project.
Regards,
We are using in project *.html files, I associated them with twig editor, but document still not recognized as Twig template
I noticed that there is a check for extenion can cause this problem src / org / eclipse / twig / ui / editor / TwigStructuredEditor.java
if ("twig".equals(resource.getFullPath().getFileExtension())) { TwigSourceParser.editFile.set(resource); super.doSetInput(input); } else { super.doSetInput(input); }