Skip to content
This repository was archived by the owner on Sep 8, 2023. It is now read-only.
This repository was archived by the owner on Sep 8, 2023. It is now read-only.

Possible features (ongoing) #1

@Allendar

Description

@Allendar

@atomi Thanks so much for making this! I never really dived into making VSCode extensions, but this is already so much better than just HTML mapping qtpl file to basic HTML.

Already love the markup. These were some things that instantly popped into my mind;

  • VSCode Go extension interpreter partially inside the template:

  • Automatically resolve imports and sort them by name ({% import "strconv" %} etc.)

  • Understanding structs/types for auto-completion

  • Jump to definition when CMD(CTRL) + Click on a var/struct/function

  • Other features:

  • Logic for the {% %}, {%s %}, {%s= %} type auto-completion and checking if the type matches

  • Making the Extended pages understand what functions they can implement. Say I'm extending a BasePage and have a Stylesheets block (function), this could auto-complete while typing {% func (p *ForgotPasswordPage) Stylesheets() %}. This probably is via {% interface (Page interface > BasePage struct > ForgotPasswordPage struct)

  • Automatically generate endings for things like {% if obj.Something() %} to pop-in {% endif %} after. Same for {% for _, user := range p.Users %} > {% endfor %}

  • {% func Stylesheets %}{% endfunc %} auto-completion

  • I have a helpers.qtpl file (kind of like Macros in Twig/Django). Reading those function definitions from other qtpl files in the same folder (e.a. {%s= FormEmailField(p.Form.Field("email")) %})

  • Make CMD(CTRL) + / actually wrap a {% comment %}{% endcomment %} instead of normal HTML commenting

  • An action via SHIFT + CMD(CTRL) + P to wrap the selected code with {% stripspace %}

  • Beautification on save (settings to turn behaviour on/off) to automatically indent the combination of QuickTemplate and HTML/CSS/JS. Making it honour the normal HTML/CSS/JS indentation and afterwards indenting QuickTemplate if/else and for definitions

  • Force a newline at the end of each file

I'll keep updating this list for things that I might see.

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions