Open JPustkuchen opened 6 years ago
This is not supported currently.
How would you expect it to be formatted? (Could you give us an example, please?)
Minimum would be HTML formatting and handling smarty like text. I'm not sure how it will behave. Perfect solution would be to format it like in other languages: indent loops / conditionals, etc.
Examples can be seen in the shopware documentation e.g.: https://developers.shopware.com/designers-guide/smarty/
But yes, handling like HTML would be a good first step for .tpl files. Currently there is no formatting possible at all and when switching them to html in configuration smarty syntax is no more being highlighted.
Okay, that's indeed very nice formatting. I'll look in my holidays(~ next 6 weeks) how I can implement that and what I need to do.
Very cool, thank you! I think some IDEs like PHPStorm already solve this. You may test a demo to see what they do.
Hi, any progress? :)
Good ping, I honestly forgot about this. Unfortunately, I'm busy at the moment. If somebody wants to provide a pull request, I'd be very glad to merge it.
Hi,
Enabling the HTML formatter for smarty templates as a minimum would make the plugin much more useful.
Thanks.
@jens1o hmm I could try at least :) Any tips?
First of all, thank you for your interest and time @kruzyk . :)
You could try implementing the same https://github.com/FabianLauer/vs-code-xml-format/blob/3402b6e5ce656bd930948ae6990638042d2af960/src/extension.ts
If we're lucky enough, the xml formatter is clever enough to just ignore smarty-specific syntax. :)
This is a good feature to have . As workaround you could change to html with Ctrl+Shift+P , "Change Language Mode". Format and then go back to smarty.
@jens1o I tried to use the xml formatter with some minor changes, but unfortunately it didn't handle. Would you find time to deal with this topic? I know that smarty is old technology, but still used in many companies and a lot of people would use it :)
Hi, thank you for this great tool!
Can you tell how I can enable code formatting (alt+shift+f) for smarty files or at least handle it like HTML? The emmet code snippet on the module page didn't help.
I think many users will have that problem.