Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>GumGo PreviewNew to Visual Studio Code? Get it now.
GumGo Preview

GumGo Preview

Preecha Gum

|
5 installs
| (0) | Free
Preview Go HTML templates (Fiber/Gin/Echo) in VS Code with click-to-jump from form controls to Go handlers, routes, JS handlers, and SQL.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GumGo Preview

VS Code extension แสดง preview ของ Go HTML template (Fiber/Gin/Echo/Chi) — คลิก control บนฟอร์มเพื่อกระโดดไป Go handler / route / JS function / struct field / SQL

Features

  • Render .html / .gohtml / .tmpl ใน webview พร้อม CSS จากโปรเจกต์ (auto-detect web/static, static, public/static, ฯลฯ)
  • Strip Go template syntax {{...}} ให้แสดงเป็น ⟨FieldName⟩ แทน
  • คลิก <input>, <select>, <textarea>, <button>, <form> → กระโดดไป:
    • Direct reads (Fiber/Gin/Echo): c.FormValue("X"), c.PostForm("X"), c.Form("X")
    • Query reads: c.Query("X"), c.QueryParam("X")
    • Path params: c.Params("X"), c.Param("X"), c.PathValue("X")
    • Struct fields by tag (NEW v0.5): กรณีใช้ c.BodyParser(&req) / c.ShouldBindJSON(&req) — extension จะเจอ field declaration ที่มี \json:"X"`` หรือ \form:"X"`` ตรงกัน
    • Routes: r.Post("/path", h.Handler) → resolve handler function declaration
    • Group chains (NEW v0.5): app.Group("/api") → api.Group("/users") → users.Get("/") รวมเป็น GET /api/users อัตโนมัติ
    • JS handlers: function/arrow function ที่ชื่อตรงกับ id ของ element หรือชื่อใน onclick="X()"
    • Chain via JS → fetch URL → Go route → handler ที่มี SQL
  • Generic router variable (NEW v0.5): รองรับชื่อตัวแปรอะไรก็ได้ (auth, protected, users, api, ฯลฯ) ไม่ใช่แค่ r/app/router
  • รองรับ Fiber, Gin, Echo, Chi (heuristic regex)
  • Auto rebuild Go index เมื่อ save .go file

Settings

Key Default คำอธิบาย
gumgoPreview.staticRoot web/static path ของ static assets
gumgoPreview.templateRoot internal/templates path ของ template files
gumgoPreview.layoutFile internal/templates/layouts/app.html layout file สำหรับ wrap partial templates
gumgoPreview.framework auto web framework convention (fiber/gin/echo/chi/nethttp/auto)

Usage

เปิดไฟล์ template (เช่น internal/templates/pages/patient_register.html) แล้ว:

  • คลิก context menu icon บน editor title → GumGo: Preview Template
  • หรือ Ctrl+Shift+P → GumGo: Preview Template
  • หรือคลิกขวาที่ไฟล์ใน Explorer → Open With... → GumGo Preview

Build

cd D:\VsCodeExtension\GumGoPreview
npm install
npm run build           # development
npm run package         # production (minified)
npx @vscode/vsce package --no-dependencies --allow-missing-repository --skip-license
code --install-extension gumgo-preview-0.1.0.vsix

ข้อจำกัด

  • Static preview เท่านั้น — ค่าใน {{.X}} แสดงเป็น ⟨X⟩ placeholder ไม่มี data จริง
  • Click-to-jump ใช้ regex-based indexer — แม่นมากกับ pattern ที่ใช้กันแพร่หลาย แต่ pattern ที่ซับซ้อนพิเศษอาจหลุด (เช่น routes ที่สร้าง path จากตัวแปร, struct binding ผ่าน middleware ที่ inject เอง)
  • ยังไม่รองรับ templ (Go templ language) — เฉพาะ html/template ของ stdlib
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft