- ๐ต Nothing serious.
- VSCode
atomi / vscode-quicktemplate Goto Github PK
View Code? Open in Web Editor NEWQuickemplate (qtpl) Language files for VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=vsatomi.vscode-quicktemplate
Quickemplate (qtpl) Language files for VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=vsatomi.vscode-quicktemplate
@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!
As I'm diving more into extension/language building for VSCode I couldn't find out yet why the HTML tags on tab-hit don't complete anymore. It also seems that any intelligence towards HTML is gone.
Maybe need to look into the Laravel Blade extension to see how it combines HTML + Blade syntax in one file.
I'll try to research it soon too, but maybe you might find a solution before that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.