-
Notifications
You must be signed in to change notification settings - Fork 2
Possible features (ongoing) #1
Description
@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/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
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-completion -
I 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 commenting -
An 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/elseandfordefinitions -
Force a newline at the end of each file
I'll keep updating this list for things that I might see.
Thanks again!