Giter VIP home page Giter VIP logo

Comments (11)

mattwaler avatar mattwaler commented on May 30, 2024 2

Exposing something similar to how prettier works would be awesome if possible! That or just exposing user settings in their JSON file for specific format options like wrapping attributes on new lines, indenting the head and body tags or not, stuff like that.

I'm not entirely sure this is possible but it would be great if it was!

from nunjucks-template.

anghelos avatar anghelos commented on May 30, 2024 1

@eseom awesome, thanks!
It looks like there are still a few bugs with indentation and new lines, however. I'll open a new issue for clarity.

from nunjucks-template.

laberin avatar laberin commented on May 30, 2024

What formatter do you prefer, for example?

from nunjucks-template.

charlesroper avatar charlesroper commented on May 30, 2024

Thanks for this extension - I've just tried a bunch of them and yours is best. 🥇

The way the Nunjucks Template Formatter extension makes it easy to change settings is great. Screenshot below. That project is now archived so maybe you could salvage some of the code from there?

For now, do you know if there's a way to force the "End self-closing tags with a space" setting right now? Nunjucks Template Formatter and yours both use prettydiff2 so I'm assuming it should be possible?

Many thanks!

image

from nunjucks-template.

anghelos avatar anghelos commented on May 30, 2024

I would also like to be able to keep line breaks. It makes my files much more legible!

from nunjucks-template.

mattwaler avatar mattwaler commented on May 30, 2024

Closing because this seems inactive!

from nunjucks-template.

eseom avatar eseom commented on May 30, 2024

@anghelos a "preserveEmptyLine" configuration was added.

Im about to see Nunjucks Template Formatter
Any suggestion is welcome

from nunjucks-template.

bruno-vaz avatar bruno-vaz commented on May 30, 2024

It would really help if the extension could respect/inherit the html.format settings, now when I activate this extension, it stops respecting the html.format.wrapAttributes setting. I don't know the complexity of implementing such a feature but I don't understand why VS Code formatters for HTML-like template languages have this problem and apparently have to reimplement basic HTML formatter settings.

from nunjucks-template.

eseom avatar eseom commented on May 30, 2024

It would really help if the extension could respect/inherit the html.format settings, now when I activate this extension, it stops respecting the html.format.wrapAttributes setting. I don't know the complexity of implementing such a feature but I don't understand why VS Code formatters for HTML-like template languages have this problem and apparently have to reimplement basic HTML formatter settings.

First of all, because of the template syntax like {{ variable }}, a new formatter have to be implemented for the formatting. This extension is using prettydiff2, Fortunately it supports a lot of options for formatting. I think it would support the option like the wrapAttributes. Instead of inheriting the original formatter, it had better to adjust the options into prettydiff2.

Could you list what options would be needed except wrapAttributes?

from nunjucks-template.

iamrealmarsel avatar iamrealmarsel commented on May 30, 2024

It would be great if this extension had options like here VS Code Twig Language 2

as an example, some of the options from there:
Screen Shot 2022-11-04 at 9 54 00 PM

from nunjucks-template.

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.