Giter VIP home page Giter VIP logo

Comments (12)

JPustkuchen avatar JPustkuchen commented on September 22, 2024 3

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/

from vscode-smarty.

jens1o avatar jens1o commented on September 22, 2024 2

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.

from vscode-smarty.

kruzyk avatar kruzyk commented on September 22, 2024 2

@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 :)

from vscode-smarty.

kruzyk avatar kruzyk commented on September 22, 2024 1

Hi,
any progress? :)

from vscode-smarty.

jens1o avatar jens1o commented on September 22, 2024

This is not supported currently.

How would you expect it to be formatted? (Could you give us an example, please?)

from vscode-smarty.

JPustkuchen avatar JPustkuchen commented on September 22, 2024

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.

from vscode-smarty.

jens1o avatar jens1o commented on September 22, 2024

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.

from vscode-smarty.

JPustkuchen avatar JPustkuchen commented on September 22, 2024

Very cool, thank you!
I think some IDEs like PHPStorm already solve this. You may test a demo to see what they do.

from vscode-smarty.

carlittoer avatar carlittoer commented on September 22, 2024

Hi,

Enabling the HTML formatter for smarty templates as a minimum would make the plugin much more useful.

Thanks.

from vscode-smarty.

kruzyk avatar kruzyk commented on September 22, 2024

@jens1o hmm I could try at least :) Any tips?

from vscode-smarty.

jens1o avatar jens1o commented on September 22, 2024

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. :)

from vscode-smarty.

agiannis avatar agiannis commented on September 22, 2024

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.

from vscode-smarty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.