You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 8, 2023. It is now read-only.
@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 %}
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.
@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) + Clickon avar/struct/functionOther features:
Logic for the
{% %},{%s %},{%s= %}type auto-completion and checking if the type matchesMaking the Extended pages understand what functions they can implement. Say I'm extending a
BasePageand have aStylesheetsblock (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-completionI have a
helpers.qtplfile (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 commentingAn action via
SHIFT + CMD(CTRL) + Pto 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 QuickTemplateif/elseandfordefinitionsForce a newline at the end of each file
I'll keep updating this list for things that I might see.
Thanks again!